-
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): incorrect generatedSchema in update…
…GQLSchema (#6349) (#6354) * fix(GraphQL): incorrect generatedSchema in updateGQLSchema (#6349) This PR fixes the behaviour where Dgraph schema was being given as generatedSchema field in updateGQLSchema request. Now, the newly generated complete GraphQL schema is given as generatedSchema. (cherry picked from commit 0b8681c) # Conflicts: # graphql/e2e/schema/schema_test.go
- Loading branch information
1 parent
71bb474
commit 110c041
Showing
3 changed files
with
254 additions
and
9 deletions.
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
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,209 @@ | ||
####################### | ||
# Input Schema | ||
####################### | ||
|
||
type Author { | ||
id: ID! | ||
name: String! | ||
} | ||
|
||
####################### | ||
# 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 AddAuthorPayload { | ||
author(filter: AuthorFilter, order: AuthorOrder, first: Int, offset: Int): [Author] | ||
numUids: Int | ||
} | ||
|
||
type DeleteAuthorPayload { | ||
author(filter: AuthorFilter, order: AuthorOrder, first: Int, offset: Int): [Author] | ||
msg: String | ||
numUids: Int | ||
} | ||
|
||
type UpdateAuthorPayload { | ||
author(filter: AuthorFilter, order: AuthorOrder, first: Int, offset: Int): [Author] | ||
numUids: Int | ||
} | ||
|
||
####################### | ||
# Generated Enums | ||
####################### | ||
|
||
enum AuthorOrderable { | ||
name | ||
} | ||
|
||
####################### | ||
# Generated Inputs | ||
####################### | ||
|
||
input AddAuthorInput { | ||
name: String! | ||
} | ||
|
||
input AuthorFilter { | ||
id: [ID!] | ||
not: AuthorFilter | ||
} | ||
|
||
input AuthorOrder { | ||
asc: AuthorOrderable | ||
desc: AuthorOrderable | ||
then: AuthorOrder | ||
} | ||
|
||
input AuthorPatch { | ||
name: String | ||
} | ||
|
||
input AuthorRef { | ||
id: ID | ||
name: String | ||
} | ||
|
||
input UpdateAuthorInput { | ||
filter: AuthorFilter! | ||
set: AuthorPatch | ||
remove: AuthorPatch | ||
} | ||
|
||
####################### | ||
# Generated Query | ||
####################### | ||
|
||
type Query { | ||
getAuthor(id: ID!): Author | ||
queryAuthor(filter: AuthorFilter, order: AuthorOrder, first: Int, offset: Int): [Author] | ||
} | ||
|
||
####################### | ||
# Generated Mutations | ||
####################### | ||
|
||
type Mutation { | ||
addAuthor(input: [AddAuthorInput!]!): AddAuthorPayload | ||
updateAuthor(input: UpdateAuthorInput!): UpdateAuthorPayload | ||
deleteAuthor(filter: AuthorFilter!): DeleteAuthorPayload | ||
} | ||
|
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