-
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.
Emit semanticNonNull in generated schema
Reviewed By: captbaritone Differential Revision: D55775523 fbshipit-source-id: 6ef31680a4aa5099c8486e6ae70699fdbbf104c4
- Loading branch information
1 parent
ddfa2b0
commit d1cf472
Showing
6 changed files
with
140 additions
and
3 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
33 changes: 33 additions & 0 deletions
33
.../crates/relay-docblock/tests/to_schema/fixtures/relay-resolver-semantic-non-null.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,33 @@ | ||
==================================== INPUT ==================================== | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// relay:allow_legacy_verbose_syntax | ||
|
||
/** | ||
* @RelayResolver | ||
* | ||
* @onType User | ||
* @fieldName favorite_page | ||
* @rootFragment myRootFragment | ||
* @semanticNonNull | ||
* | ||
* The user's favorite page! They probably clicked something in the UI | ||
* to tell us that it was their favorite page and then we put that in a | ||
* database or something. Then we got that info out again and put it out | ||
* again. Anyway, I'm rambling now. Its a page that the user likes. A lot. | ||
*/ | ||
|
||
graphql` | ||
fragment myRootFragment on User { | ||
id | ||
} | ||
` | ||
==================================== OUTPUT =================================== | ||
extend type User { | ||
favorite_page: RelayResolverValue @relay_resolver(import_path: "/path/to/test/fixture/relay-resolver-semantic-non-null.js", fragment_name: "myRootFragment", import_name: "favorite_page") @resolver_source_hash(value: "5f25cc9a9a8677d930bf1e8b447a769d") @semanticNonNull | ||
} |
28 changes: 28 additions & 0 deletions
28
compiler/crates/relay-docblock/tests/to_schema/fixtures/relay-resolver-semantic-non-null.js
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 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// relay:allow_legacy_verbose_syntax | ||
|
||
/** | ||
* @RelayResolver | ||
* | ||
* @onType User | ||
* @fieldName favorite_page | ||
* @rootFragment myRootFragment | ||
* @semanticNonNull | ||
* | ||
* The user's favorite page! They probably clicked something in the UI | ||
* to tell us that it was their favorite page and then we put that in a | ||
* database or something. Then we got that info out again and put it out | ||
* again. Anyway, I'm rambling now. Its a page that the user likes. A lot. | ||
*/ | ||
|
||
graphql` | ||
fragment myRootFragment on User { | ||
id | ||
} | ||
` |
28 changes: 28 additions & 0 deletions
28
...s/relay-docblock/tests/to_schema/fixtures/terse-relay-resolver-semantic-non-null.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,28 @@ | ||
==================================== INPUT ==================================== | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @RelayResolver User.favorite_page: Page | ||
* @rootFragment myRootFragment | ||
* @semanticNonNull | ||
* | ||
* The user's favorite page! They probably clicked something in the UI | ||
* to tell us that it was their favorite page and then we put that in a | ||
* database or something. Then we got that info out again and put it out | ||
* again. Anyway, I'm rambling now. Its a page that the user likes. A lot. | ||
*/ | ||
|
||
graphql` | ||
fragment myRootFragment on User { | ||
id | ||
} | ||
` | ||
==================================== OUTPUT =================================== | ||
extend type User { | ||
favorite_page: Page @relay_resolver(import_path: "/path/to/test/fixture/terse-relay-resolver-semantic-non-null.js", fragment_name: "myRootFragment", import_name: "favorite_page") @resolver_source_hash(value: "27524a0a58f36e5480cea6a72c2c0a88") @semanticNonNull | ||
} |
23 changes: 23 additions & 0 deletions
23
.../crates/relay-docblock/tests/to_schema/fixtures/terse-relay-resolver-semantic-non-null.js
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,23 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @RelayResolver User.favorite_page: Page | ||
* @rootFragment myRootFragment | ||
* @semanticNonNull | ||
* | ||
* The user's favorite page! They probably clicked something in the UI | ||
* to tell us that it was their favorite page and then we put that in a | ||
* database or something. Then we got that info out again and put it out | ||
* again. Anyway, I'm rambling now. Its a page that the user likes. A lot. | ||
*/ | ||
|
||
graphql` | ||
fragment myRootFragment on User { | ||
id | ||
} | ||
` |
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