-
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.
Fix incorrect type generation with @required on pluarl fragments
Reviewed By: kassens Differential Revision: D35344295 fbshipit-source-id: 031a08e98c9d8179f33901d86e54c37dec5a02ba
- Loading branch information
1 parent
9ec4e78
commit 5a9d42e
Showing
7 changed files
with
295 additions
and
11 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
32 changes: 32 additions & 0 deletions
32
...ay-typegen/tests/generate_flow/fixtures/required-bubbles-to-plural-fragment-root.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,32 @@ | ||
==================================== INPUT ==================================== | ||
fragment SomeFragment on User @relay(plural: true) { | ||
name @required(action: LOG) | ||
} | ||
|
||
fragment SomeOtherFragment on User @relay(plural: true) { | ||
name | ||
} | ||
==================================== OUTPUT =================================== | ||
import type { FragmentType } from "relay-runtime"; | ||
declare export opaque type SomeFragment$fragmentType: FragmentType; | ||
export type SomeFragment$data = $ReadOnlyArray<?{| | ||
+name: string, | ||
+$fragmentType: SomeFragment$fragmentType, | ||
|}>; | ||
export type SomeFragment$key = $ReadOnlyArray<{ | ||
+$data?: SomeFragment$data, | ||
+$fragmentSpreads: SomeFragment$fragmentType, | ||
... | ||
}>; | ||
------------------------------------------------------------------------------- | ||
import type { FragmentType } from "relay-runtime"; | ||
declare export opaque type SomeOtherFragment$fragmentType: FragmentType; | ||
export type SomeOtherFragment$data = $ReadOnlyArray<{| | ||
+name: ?string, | ||
+$fragmentType: SomeOtherFragment$fragmentType, | ||
|}>; | ||
export type SomeOtherFragment$key = $ReadOnlyArray<{ | ||
+$data?: SomeOtherFragment$data, | ||
+$fragmentSpreads: SomeOtherFragment$fragmentType, | ||
... | ||
}>; |
7 changes: 7 additions & 0 deletions
7
...lay-typegen/tests/generate_flow/fixtures/required-bubbles-to-plural-fragment-root.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,7 @@ | ||
fragment SomeFragment on User @relay(plural: true) { | ||
name @required(action: LOG) | ||
} | ||
|
||
fragment SomeOtherFragment on User @relay(plural: true) { | ||
name | ||
} |
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
135 changes: 135 additions & 0 deletions
135
...lay-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest24Query.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
...y-runtime/store/__tests__/__generated__/RelayReaderRequiredFieldsTest6Fragment.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.