-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete the escaped field name in favor of unescaped/original field na…
…me to keep the expected structure (#4220)
- Loading branch information
Showing
3 changed files
with
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
"@omnigraph/json-schema": patch | ||
--- | ||
|
||
Delete the escaped field name in favor of unescaped/original field name to keep the expected structure | ||
|
||
For example if you have `foo-bar` in your request input, it is sanitized to `foo_bar` in order to fit the requirements of GraphQL specification. But then, JSON Schema loader recovers it to the original `foo-bar` field name before sending request. But it was sending both field names. | ||
|
||
```graphql | ||
input FooBar { | ||
foo_bar: String | ||
} | ||
``` | ||
|
||
Before; | ||
```json | ||
{ | ||
"foo-bar": "baz", | ||
"foo_bar": "baz" | ||
} | ||
``` | ||
|
||
After; | ||
```json | ||
{ | ||
"foo-bar": "baz" | ||
} | ||
``` |
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