-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate against using Relay Resolvers in typesafe updaters
Reviewed By: davidmccabe Differential Revision: D41325936 fbshipit-source-id: 3b8c6e339ad91823ebdd4d7b89e0971ab47e4df4
- Loading branch information
1 parent
11d22f0
commit 98e7700
Showing
7 changed files
with
133 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
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
29 changes: 29 additions & 0 deletions
29
...ates/relay-transforms/tests/updatable_directive/fixtures/resolver-linked.invalid.expected
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,29 @@ | ||
==================================== INPUT ==================================== | ||
# expected-to-throw | ||
query resolverQuery @updatable { | ||
resolver_field { | ||
id | ||
} | ||
} | ||
|
||
# %extensions% | ||
|
||
extend type Query { | ||
resolver_field: User @relay_resolver(import_path: "ResolverModule") | ||
} | ||
==================================== ERROR ==================================== | ||
✖︎ Fields defined using Relay Resolvers are not not allowed within @updatable operations. | ||
|
||
resolver-linked.invalid.graphql:3:3 | ||
2 │ query resolverQuery @updatable { | ||
3 │ resolver_field { | ||
│ ^^^^^^^^^^^^^^ | ||
4 │ id | ||
|
||
ℹ︎ The field is defined here: | ||
|
||
<generated>:2:5 | ||
1 │ # expected-to-throw | ||
2 │ query resolverQuery @updatable { | ||
│ ^^^^^^^^^^^^^^ | ||
3 │ resolver_field { |
12 changes: 12 additions & 0 deletions
12
...rates/relay-transforms/tests/updatable_directive/fixtures/resolver-linked.invalid.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 @@ | ||
# expected-to-throw | ||
query resolverQuery @updatable { | ||
resolver_field { | ||
id | ||
} | ||
} | ||
|
||
# %extensions% | ||
|
||
extend type Query { | ||
resolver_field: User @relay_resolver(import_path: "ResolverModule") | ||
} |
27 changes: 27 additions & 0 deletions
27
...ates/relay-transforms/tests/updatable_directive/fixtures/resolver-scalar.invalid.expected
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,27 @@ | ||
==================================== INPUT ==================================== | ||
# expected-to-throw | ||
query resolverQuery @updatable { | ||
resolver_field | ||
} | ||
|
||
# %extensions% | ||
|
||
extend type Query { | ||
resolver_field: Boolean @relay_resolver(import_path: "ResolverModule") | ||
} | ||
==================================== ERROR ==================================== | ||
✖︎ Fields defined using Relay Resolvers are not not allowed within @updatable operations. | ||
|
||
resolver-scalar.invalid.graphql:3:3 | ||
2 │ query resolverQuery @updatable { | ||
3 │ resolver_field | ||
│ ^^^^^^^^^^^^^^ | ||
4 │ } | ||
|
||
ℹ︎ The field is defined here: | ||
|
||
<generated>:2:5 | ||
1 │ # expected-to-throw | ||
2 │ query resolverQuery @updatable { | ||
│ ^^^^^^^^^^^^^^ | ||
3 │ resolver_field |
10 changes: 10 additions & 0 deletions
10
...rates/relay-transforms/tests/updatable_directive/fixtures/resolver-scalar.invalid.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,10 @@ | ||
# expected-to-throw | ||
query resolverQuery @updatable { | ||
resolver_field | ||
} | ||
|
||
# %extensions% | ||
|
||
extend type Query { | ||
resolver_field: Boolean @relay_resolver(import_path: "ResolverModule") | ||
} |
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