-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid infinity recursiveness in getVariablesJSONSchema (#2917)
* fix: avoid infinity recursiveness in getVariablesJSONSchema add a marker to mark analyzed InputObject to avoid infinity recursiveness while generating JsonSchema. set $ref field for definition while recursion is found put marker into options to avoid extra parameters add test unit for this bug Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
- Loading branch information
1 parent
42f2978
commit f788e65
Showing
4 changed files
with
128 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"graphql-language-service": patch | ||
--- | ||
|
||
Fix infinite recursiveness in getVariablesJSONSchema when the schema contains types that reference themselves |
21 changes: 21 additions & 0 deletions
21
packages/graphql-language-service/src/utils/__tests__/__schema__/RecursiveSchema.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,21 @@ | ||
schema { | ||
query: query_root | ||
} | ||
|
||
input string_options { | ||
_eq: String | ||
_ilike: String | ||
} | ||
|
||
type issues { | ||
name: String | ||
} | ||
|
||
input issues_where_input { | ||
_and: [issues_where_input!] | ||
name: string_options | ||
} | ||
|
||
type query_root { | ||
issues(where: issues_where_input): [issues!]! | ||
} |
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