-
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.
Update normalization artifacts for exec time resolver strong ids
Summary: This diff updates artifact generation for exec time resolvers to include the resolver module in the normalization AST. It's fairly similar to how the reader AST is built but we need far less information at normalization time. This is the most basic version of the artifact and we may need to add additional fields as the feature continues to be built. Reviewed By: captbaritone Differential Revision: D64635272 fbshipit-source-id: 3627fbb51570e4559bf98a0334b136d11d0f0de1
- Loading branch information
1 parent
356327c
commit d036d49
Showing
17 changed files
with
513 additions
and
143 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
86 changes: 86 additions & 0 deletions
86
.../crates/relay-codegen/tests/client_edges/fixtures/client-edge-exec-time-resolver.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,86 @@ | ||
==================================== INPUT ==================================== | ||
query Foo @exec_time_resolvers { | ||
me { | ||
pet { | ||
name | ||
} | ||
} | ||
} | ||
|
||
# %extensions% | ||
|
||
directive @exec_time_resolvers on QUERY | ||
|
||
type Cat @__RelayResolverModel { | ||
name: String | ||
@relay_resolver(import_name: "name", import_path: "CatNameResolver") | ||
__relay_model_instance: RelayResolverValue! | ||
@relay_resolver(import_name: "Cat") | ||
@unselectable( | ||
reason: "This field is intended only for Relay's internal use" | ||
) | ||
} | ||
|
||
extend type User { | ||
pet: Cat @relay_resolver(import_name: "Pet", import_path: "PetResolver") | ||
} | ||
==================================== OUTPUT =================================== | ||
{ | ||
"argumentDefinitions": [], | ||
"kind": "Operation", | ||
"name": "Foo", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "User", | ||
"kind": "LinkedField", | ||
"name": "me", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"kind": "ClientEdgeToClientObject", | ||
"modelResolvers": { | ||
"Cat": { | ||
"resolverModule": require('<generated>').Cat | ||
} | ||
}, | ||
"backingField": { | ||
"name": "pet", | ||
"args": null, | ||
"kind": "RelayResolver", | ||
"storageKey": null, | ||
"isOutputType": false, | ||
"resolverInfo": { | ||
"resolverFunction": require('PetResolver').Pet, | ||
"rootFragment": null | ||
} | ||
}, | ||
"linkedField": { | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "Cat", | ||
"kind": "LinkedField", | ||
"name": "pet", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"name": "name", | ||
"args": null, | ||
"kind": "RelayResolver", | ||
"storageKey": null, | ||
"isOutputType": false, | ||
"resolverInfo": { | ||
"resolverFunction": require('CatNameResolver').name, | ||
"rootFragment": null | ||
} | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
] | ||
} |
25 changes: 25 additions & 0 deletions
25
...r/crates/relay-codegen/tests/client_edges/fixtures/client-edge-exec-time-resolver.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,25 @@ | ||
query Foo @exec_time_resolvers { | ||
me { | ||
pet { | ||
name | ||
} | ||
} | ||
} | ||
|
||
# %extensions% | ||
|
||
directive @exec_time_resolvers on QUERY | ||
|
||
type Cat @__RelayResolverModel { | ||
name: String | ||
@relay_resolver(import_name: "name", import_path: "CatNameResolver") | ||
__relay_model_instance: RelayResolverValue! | ||
@relay_resolver(import_name: "Cat") | ||
@unselectable( | ||
reason: "This field is intended only for Relay's internal use" | ||
) | ||
} | ||
|
||
extend type User { | ||
pet: Cat @relay_resolver(import_name: "Pet", import_path: "PetResolver") | ||
} |
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
Oops, something went wrong.