-
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.
Fix(GraphQL): This PR add schema cleaning in GraphQL. (#6427)
Fixes GRAPHQL-572 This PR adds schema cleaning in GraphQL which will remove empty links and types from generated GraphQL schema recursively.
- Loading branch information
1 parent
288eafb
commit bec5322
Showing
13 changed files
with
1,133 additions
and
18 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
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
12 changes: 12 additions & 0 deletions
12
graphql/schema/testdata/schemagen/input/filter-cleanSchema-all-empty.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,12 @@ | ||
type X { | ||
name: [Y] | ||
f1: [Y] @dgraph(pred: "f1") | ||
} | ||
|
||
type Y { | ||
f1: [X] @dgraph(pred: "~f1") | ||
} | ||
|
||
type Z { | ||
add:[X] | ||
} |
14 changes: 14 additions & 0 deletions
14
graphql/schema/testdata/schemagen/input/filter-cleanSchema-circular.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,14 @@ | ||
type X{ | ||
f1: [Y] @dgraph(pred: "f1") | ||
f3: [Z] @dgraph(pred: "~f3") | ||
} | ||
|
||
type Y{ | ||
f1: [X] @dgraph(pred: "~f1") | ||
f2: [Z] @dgraph(pred: "f2") | ||
} | ||
|
||
type Z{ | ||
f2: [Y] @dgraph(pred: "~f2") | ||
f3: [X] @dgraph(pred: "f3") | ||
} |
16 changes: 16 additions & 0 deletions
16
graphql/schema/testdata/schemagen/input/filter-cleanSchema-custom-mutation.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,16 @@ | ||
type User { | ||
id: ID! | ||
name: String! | ||
} | ||
|
||
input UserInput { | ||
name: String! | ||
} | ||
|
||
type Mutation { | ||
addMyFavouriteUsers(input: [UserInput!]!): [User] @custom(http: { | ||
url: "http://my-api.com", | ||
method: "POST", | ||
body: "{ data: $input }" | ||
}) | ||
} |
14 changes: 14 additions & 0 deletions
14
graphql/schema/testdata/schemagen/input/filter-cleanSchema-directLink.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,14 @@ | ||
type X { | ||
f1: [Y] @dgraph(pred: "f1") | ||
name: String | ||
id: ID | ||
} | ||
|
||
type Y { | ||
f2: [Z] @dgraph(pred: "~f2") | ||
f1: [X] @dgraph(pred: "~f1") | ||
} | ||
|
||
type Z { | ||
f2: [Y] @dgraph(pred: "f2") | ||
} |
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
Oops, something went wrong.