-
-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved
parse
to support converting comments into descriptions (#1900
- Loading branch information
1 parent
640de85
commit 46c5700
Showing
8 changed files
with
336 additions
and
16 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
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
107 changes: 107 additions & 0 deletions
107
packages/utils/tests/__snapshots__/parse-graphql-sdl.spec.ts.snap
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,107 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`parse sdl comment parsing should transform comments to descriptions correctly on all available nodes 1`] = ` | ||
"\\"test type comment\\" | ||
type Type { | ||
\\"test field comment\\" | ||
f1: String! | ||
\\"\\"\\" | ||
Line 1 | ||
Line 2 | ||
\\"\\"\\" | ||
f2: String! | ||
\\"\\"\\" | ||
line 2 | ||
Line 1 | ||
\\"\\"\\" | ||
f3: String! | ||
} | ||
extend type Type { | ||
\\"test extension field comment\\" | ||
f4: String! | ||
} | ||
type OtherType implements Node { | ||
id: ID! | ||
f: String! | ||
} | ||
\\"input test\\" | ||
input Input { | ||
\\"Input field test\\" | ||
f: String | ||
} | ||
\\"Enum test\\" | ||
enum Enum { | ||
\\"Enum value test\\" | ||
V1 | ||
V2 | ||
} | ||
\\"Union test\\" | ||
union Union = Type | OtherType | ||
\\"Inferface test\\" | ||
interface Node { | ||
id: ID! | ||
} | ||
\\"Custom scalar test\\" | ||
scalar Date | ||
" | ||
`; | ||
|
||
exports[`parse sdl comment parsing should transform comments to descriptions correctly on all available nodes with noLocation=true 1`] = ` | ||
"\\"test type comment\\" | ||
type Type { | ||
\\"test field comment\\" | ||
f1: String! | ||
\\"\\"\\" | ||
Line 1 | ||
Line 2 | ||
\\"\\"\\" | ||
f2: String! | ||
\\"\\"\\" | ||
line 2 | ||
Line 1 | ||
\\"\\"\\" | ||
f3: String! | ||
} | ||
extend type Type { | ||
\\"test extension field comment\\" | ||
f4: String! | ||
} | ||
type OtherType implements Node { | ||
id: ID! | ||
f: String! | ||
} | ||
\\"input test\\" | ||
input Input { | ||
\\"Input field test\\" | ||
f: String | ||
} | ||
\\"Enum test\\" | ||
enum Enum { | ||
\\"Enum value test\\" | ||
V1 | ||
V2 | ||
} | ||
\\"Union test\\" | ||
union Union = Type | OtherType | ||
\\"Inferface test\\" | ||
interface Node { | ||
id: ID! | ||
} | ||
\\"Custom scalar test\\" | ||
scalar Date | ||
" | ||
`; |
Oops, something went wrong.