Skip to content

Commit

Permalink
graphql: Return better error message if a type only contains ID field (
Browse files Browse the repository at this point in the history
…#5531)

Fixes GRAPHQL-449
  • Loading branch information
pawanrawal authored May 29, 2020
1 parent 4757813 commit 60882e7
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 37 deletions.
11 changes: 6 additions & 5 deletions graphql/e2e/custom_logic/custom_logic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func TestServerShouldAllowForwardHeaders(t *testing.T) {
id: ID!
name: String!
}
type Movie @remote {
type Movie {
id: ID!
name: String! @custom(http: {
url: "http://mock:8888/movieName",
Expand All @@ -235,6 +235,7 @@ func TestServerShouldAllowForwardHeaders(t *testing.T) {
method: "POST",
forwardHeaders: ["User-Id", "X-App-Token"]
})
foo: String
}
type Query {
Expand Down Expand Up @@ -2098,9 +2099,9 @@ func TestRestCustomLogicInDeepNestedField(t *testing.T) {
type SearchTweets {
id: ID!
text: String!
user: User
user: User
}
type User {
id: ID!
screen_name: String! @id
Expand All @@ -2110,12 +2111,12 @@ func TestRestCustomLogicInDeepNestedField(t *testing.T) {
})
tweets: [SearchTweets] @hasInverse(field: user)
}
type RemoteUser @remote {
id: ID!
name: String
}
type Followers@remote{
users: [RemoteUser]
}
Expand Down
6 changes: 6 additions & 0 deletions graphql/schema/dgraph_schemagen_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ schemas:
}
type P {
id: ID!
q: A
}
output: |
type A {
A.p
}
A.p: uid .
type P {
P.q
}
P.q: uid .
-
name: "Scalar list"
Expand Down Expand Up @@ -54,14 +57,17 @@ schemas:
}
type P {
id: ID!
name: String
}
output: |
type X {
X.p
}
X.p: [uid] .
type P {
P.name
}
P.name: string .
-
name: "Scalar types"
Expand Down
Loading

0 comments on commit 60882e7

Please sign in to comment.