Skip to content

Commit

Permalink
[RelayCompilerError] Use graphql-js exported utils
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Jun 26, 2019
1 parent 1568da2 commit 9787cdd
Show file tree
Hide file tree
Showing 15 changed files with 510 additions and 632 deletions.
Expand Up @@ -43,7 +43,7 @@ GraphQL Validation Error: Expected type Boolean, found "true".
>
> isViewerFriend: "true"
> ^^^
GraphQL Validation Error: Expected type Gender, found "MALE"; Did you mean the enum value MALE or FEMALE?
GraphQL Validation Error: Expected type Gender, found "MALE". Did you mean the enum value MALE or FEMALE?
>
> gender: "MALE"
> ^^^
Expand Down
Expand Up @@ -13,10 +13,10 @@ ERROR:
NormalizationCodeGenerator: Complex argument values (Lists or InputObjects with nested variables) are not supported.
Source: GraphQL request:2:17
1: query TestQuery($date: String) {
2: items(filter: {date: $date}) {
^
3: date
1 | query TestQuery($date: String) {
2 | items(filter: {date: $date}) {
| ^
3 | date

This comment has been minimized.

Copy link
@alloy

alloy Jun 26, 2019

Author Contributor

These changes are from graphql/graphql-js#1985

`;
Expand Down
Expand Up @@ -3287,19 +3287,19 @@ Error: Encountered 2 error(s):
- $commentsKey: String.
Source (derived): GraphQL request:25:26
24: key: "FeedbackFragment_comments"
25: dynamicKey_UNSTABLE: $commentsKey
^
26: filters: ["orderby"]
24 | key: "FeedbackFragment_comments"
25 | dynamicKey_UNSTABLE: $commentsKey
| ^
26 | filters: ["orderby"]
- Operation 'PaginationQuery' references undefined variable(s):
- $commentsKey: String.
Source (derived): GraphQL request:25:26
24: key: "FeedbackFragment_comments"
25: dynamicKey_UNSTABLE: $commentsKey
^
26: filters: ["orderby"]
24 | key: "FeedbackFragment_comments"
25 | dynamicKey_UNSTABLE: $commentsKey
| ^
26 | filters: ["orderby"]
`;

Expand Down Expand Up @@ -4152,34 +4152,32 @@ THROWN EXCEPTION:
Error: Found a circular reference from fragment 'Profile'.
Source (derived): GraphQL request:2:1
1: # expected-to-throw
2: fragment RefetchableFragment on Query @refetchable(queryName: "RefetchableFragmentQuery") @argumentDefinitions(id: {type: "ID!"}) {
^
3: node(id: $id) {
2 | fragment RefetchableFragment on Query @refetchable(queryName: "RefetchableFragme
| ^
| ntQuery") @argumentDefinitions(id: {type: "ID!"}) {
Source (derived): GraphQL request:2:1
1: # expected-to-throw
2: fragment RefetchableFragment on Query @refetchable(queryName: "RefetchableFragmentQuery") @argumentDefinitions(id: {type: "ID!"}) {
^
3: node(id: $id) {
2 | fragment RefetchableFragment on Query @refetchable(queryName: "RefetchableFragme
| ^
| ntQuery") @argumentDefinitions(id: {type: "ID!"}) {
Source: GraphQL request:7:7
6: name
7: ...Profile @arguments(includeProfile: true)
^
8: }
6 | name
7 | ...Profile @arguments(includeProfile: true)
| ^
8 | }
Source: GraphQL request:21:9
20: node {
21: ...Profile
^
22: }
20 | node {
21 | ...Profile
| ^
22 | }
Source: GraphQL request:21:9
20: node {
21: ...Profile
^
22: }
20 | node {
21 | ...Profile
| ^
22 | }
`;
Expand Down Expand Up @@ -4928,16 +4926,16 @@ Error: Encountered 1 error(s):
- Unexpected directive: @defer. This directive can only be used on fields/fragments that are fetched from the server schema, but it is used inside a client-only selection.
Source (derived): GraphQL request:12:23
11: emailAddresses
12: ...DeferredFragment @defer(label: "DeferredFragmentLabel")
^
13: }
11 | emailAddresses
12 | ...DeferredFragment @defer(label: "DeferredFragmentLabel")
| ^
13 | }
Source (derived): GraphQL request:12:3
11: emailAddresses
12: ...DeferredFragment @defer(label: "DeferredFragmentLabel")
^
13: }
11 | emailAddresses
12 | ...DeferredFragment @defer(label: "DeferredFragmentLabel")
| ^
13 | }
`;
Expand Down Expand Up @@ -5335,16 +5333,16 @@ Error: Encountered 1 error(s):
- Cannot use @relay(mask: false) on fragment spreads for fragments with directives.
Source: GraphQL request:5:5
4: me {
5: ...Profile @relay(mask: false)
^
6: }
4 | me {
5 | ...Profile @relay(mask: false)
| ^
6 | }
Source: GraphQL request:9:26
8:
9: fragment Profile on User @inline {
^
10: id
8 |
9 | fragment Profile on User @inline {
| ^
10 | id
`;
Expand Down Expand Up @@ -5735,10 +5733,10 @@ Error: Encountered 1 error(s):
- Variables are not yet supported inside @inline fragments.
Source: GraphQL request:10:24
9: fragment Profile on User @inline {
10: profilePicture(size: $pictureSize) {
^
11: uri
9 | fragment Profile on User @inline {
10 | profilePicture(size: $pictureSize) {
| ^
11 | uri
`;
Expand Down Expand Up @@ -5773,10 +5771,10 @@ Error: Encountered 1 error(s):
- Variables are not yet supported inside @inline fragments.
Source: GraphQL request:17:24
16: @inline
17: @argumentDefinitions(sizeArg: { type: "[Int]", defaultValue: [50] }) {
^
18: profilePicture(size: $sizeArg) {
16 | @inline
17 | @argumentDefinitions(sizeArg: { type: "[Int]", defaultValue: [50] }) {
| ^
18 | profilePicture(size: $sizeArg) {
`;
Expand Down Expand Up @@ -6582,16 +6580,16 @@ Error: Encountered 1 error(s):
- Found conflicting @module selections: use a unique alias on the parent fields.
Source: GraphQL request:22:7
21: ...MarkdownUserNameRenderer_name
22: @module(name: "BarMarkdownUserNameRenderer.react")
^
23: }
21 | ...MarkdownUserNameRenderer_name
22 | @module(name: "BarMarkdownUserNameRenderer.react")
| ^
23 | }
Source: GraphQL request:13:7
12: ...MarkdownUserNameRenderer_name
13: @module(name: "FooMarkdownUserNameRenderer.react")
^
14: }
12 | ...MarkdownUserNameRenderer_name
13 | @module(name: "FooMarkdownUserNameRenderer.react")
| ^
14 | }
`;
Expand Down Expand Up @@ -6784,16 +6782,16 @@ Error: Encountered 1 error(s):
- Required argument 'capitalize: Boolean!' is missing on 'nameWithArgs' in 'TestQuery'.
Source: GraphQL request:5:7
4: hometown{
5: nameWithArgs
^
6: }
4 | hometown{
5 | nameWithArgs
| ^
6 | }
Source: GraphQL request:2:1
1: # expected-to-throw
2: query TestQuery {
^
3: node {
1 | # expected-to-throw
2 | query TestQuery {
| ^
3 | node {
`;
Expand Down Expand Up @@ -7473,16 +7471,16 @@ Error: Encountered 1 error(s):
- Found conflicting @module selections: use a unique alias on the parent fields.
Source: GraphQL request:25:7
24: ...MarkdownUserNameRenderer_name
25: @module(name: "BarMarkdownUserNameRenderer.react")
^
26: }
24 | ...MarkdownUserNameRenderer_name
25 | @module(name: "BarMarkdownUserNameRenderer.react")
| ^
26 | }
Source: GraphQL request:13:7
12: ...MarkdownUserNameRenderer_name
13: @module(name: "FooMarkdownUserNameRenderer.react")
^
14: ...PlainUserNameRenderer_name
12 | ...MarkdownUserNameRenderer_name
13 | @module(name: "FooMarkdownUserNameRenderer.react")
| ^
14 | ...PlainUserNameRenderer_name
`;
Expand Down Expand Up @@ -12998,16 +12996,16 @@ Error: Encountered 1 error(s):
- RelayMaskTransform: Cannot use @relay(mask: false) on fragment spread because the fragment definition uses @argumentDefinitions.
Source: GraphQL request:5:5
4: me {
5: ...User_user @relay(mask: false)
^
6: }
4 | me {
5 | ...User_user @relay(mask: false)
| ^
6 | }
Source: GraphQL request:10:24
9: fragment User_user on User
10: @argumentDefinitions(isRelative: {type: "Boolean!", defaultValue: false}) {
^
11:
9 | fragment User_user on User
10 | @argumentDefinitions(isRelative: {type: "Boolean!", defaultValue: false}) {
| ^
11 |
`;
Expand Down Expand Up @@ -13424,17 +13422,16 @@ Error: RelayParser: Encountered 1 error(s):
- Variable @arguments values are only supported when the argument is defined with @argumentDefinitions. Check the definition of fragment 'ProfilePhoto'.
GraphQL request:16:36
15: __typename
16: ...ProfilePhoto @arguments(size: $size)
^
17: }
15 | __typename
16 | ...ProfilePhoto @arguments(size: $size)
| ^
17 | }
GraphQL request:19:1
18:
19: fragment ProfilePhoto on User {
^
20: profilePicture(size: [100]) {
18 |
19 | fragment ProfilePhoto on User {
| ^
20 | profilePicture(size: [100]) {
`;
exports[`compileRelayArtifacts matches expected output: unused-fragment-argdef-unchecked.graphql 1`] = `
Expand Down

0 comments on commit 9787cdd

Please sign in to comment.