-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cherry-pick v20.07: fix(GraphQL): Generate correct schema when no ord…
…erable field in a ty… (#6460) fix(GraphQL): Generate correct schema when no orderable field in a type (#6456) Fixes GRAPHQL-650 It was introduced after #6392. (cherry picked from commit 8e4d121)
- Loading branch information
1 parent
88cc572
commit fcbecc1
Showing
3 changed files
with
214 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
graphql/schema/testdata/schemagen/input/type-without-orderables.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type Data { | ||
id: ID! | ||
intList: [Int] | ||
stringList: [String] | ||
metaData: Data | ||
} |
203 changes: 203 additions & 0 deletions
203
graphql/schema/testdata/schemagen/output/type-without-orderables.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
####################### | ||
# Input Schema | ||
####################### | ||
|
||
type Data { | ||
id: ID! | ||
intList: [Int] | ||
stringList: [String] | ||
metaData(filter: DataFilter): Data | ||
} | ||
|
||
####################### | ||
# Extended Definitions | ||
####################### | ||
|
||
scalar DateTime | ||
|
||
enum DgraphIndex { | ||
int | ||
float | ||
bool | ||
hash | ||
exact | ||
term | ||
fulltext | ||
trigram | ||
regexp | ||
year | ||
month | ||
day | ||
hour | ||
} | ||
|
||
input AuthRule { | ||
and: [AuthRule] | ||
or: [AuthRule] | ||
not: AuthRule | ||
rule: String | ||
} | ||
|
||
enum HTTPMethod { | ||
GET | ||
POST | ||
PUT | ||
PATCH | ||
DELETE | ||
} | ||
|
||
enum Mode { | ||
BATCH | ||
SINGLE | ||
} | ||
|
||
input CustomHTTP { | ||
url: String! | ||
method: HTTPMethod! | ||
body: String | ||
graphql: String | ||
mode: Mode | ||
forwardHeaders: [String!] | ||
secretHeaders: [String!] | ||
introspectionHeaders: [String!] | ||
skipIntrospection: Boolean | ||
} | ||
|
||
directive @hasInverse(field: String!) on FIELD_DEFINITION | ||
directive @search(by: [DgraphIndex!]) on FIELD_DEFINITION | ||
directive @dgraph(type: String, pred: String) on OBJECT | INTERFACE | FIELD_DEFINITION | ||
directive @id on FIELD_DEFINITION | ||
directive @withSubscription on OBJECT | INTERFACE | ||
directive @secret(field: String!, pred: String) on OBJECT | INTERFACE | ||
directive @auth( | ||
query: AuthRule, | ||
add: AuthRule, | ||
update: AuthRule, | ||
delete:AuthRule) on OBJECT | ||
directive @custom(http: CustomHTTP) on FIELD_DEFINITION | ||
directive @remote on OBJECT | INTERFACE | ||
directive @cascade on FIELD | ||
|
||
input IntFilter { | ||
eq: Int | ||
le: Int | ||
lt: Int | ||
ge: Int | ||
gt: Int | ||
} | ||
|
||
input FloatFilter { | ||
eq: Float | ||
le: Float | ||
lt: Float | ||
ge: Float | ||
gt: Float | ||
} | ||
|
||
input DateTimeFilter { | ||
eq: DateTime | ||
le: DateTime | ||
lt: DateTime | ||
ge: DateTime | ||
gt: DateTime | ||
} | ||
|
||
input StringTermFilter { | ||
allofterms: String | ||
anyofterms: String | ||
} | ||
|
||
input StringRegExpFilter { | ||
regexp: String | ||
} | ||
|
||
input StringFullTextFilter { | ||
alloftext: String | ||
anyoftext: String | ||
} | ||
|
||
input StringExactFilter { | ||
eq: String | ||
le: String | ||
lt: String | ||
ge: String | ||
gt: String | ||
} | ||
|
||
input StringHashFilter { | ||
eq: String | ||
} | ||
|
||
####################### | ||
# Generated Types | ||
####################### | ||
|
||
type AddDataPayload { | ||
data(filter: DataFilter, first: Int, offset: Int): [Data] | ||
numUids: Int | ||
} | ||
|
||
type DeleteDataPayload { | ||
data(filter: DataFilter, first: Int, offset: Int): [Data] | ||
msg: String | ||
numUids: Int | ||
} | ||
|
||
type UpdateDataPayload { | ||
data(filter: DataFilter, first: Int, offset: Int): [Data] | ||
numUids: Int | ||
} | ||
|
||
####################### | ||
# Generated Inputs | ||
####################### | ||
|
||
input AddDataInput { | ||
intList: [Int] | ||
stringList: [String] | ||
metaData: DataRef | ||
} | ||
|
||
input DataFilter { | ||
id: [ID!] | ||
not: DataFilter | ||
} | ||
|
||
input DataPatch { | ||
intList: [Int] | ||
stringList: [String] | ||
metaData: DataRef | ||
} | ||
|
||
input DataRef { | ||
id: ID | ||
intList: [Int] | ||
stringList: [String] | ||
metaData: DataRef | ||
} | ||
|
||
input UpdateDataInput { | ||
filter: DataFilter! | ||
set: DataPatch | ||
remove: DataPatch | ||
} | ||
|
||
####################### | ||
# Generated Query | ||
####################### | ||
|
||
type Query { | ||
getData(id: ID!): Data | ||
queryData(filter: DataFilter, first: Int, offset: Int): [Data] | ||
} | ||
|
||
####################### | ||
# Generated Mutations | ||
####################### | ||
|
||
type Mutation { | ||
addData(input: [AddDataInput!]!): AddDataPayload | ||
updateData(input: UpdateDataInput!): UpdateDataPayload | ||
deleteData(filter: DataFilter!): DeleteDataPayload | ||
} | ||
|