-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relay: fix generated artifacts of 'useRefetchableFragment'
This issue affects upstream as well, see: facebook/relay#3404 We have the advantage of having the generated output under control so I fixed it here for `@adeira/relay` and reported it to the upstream. adeira-source-id: 079091984297d98698575e38e48da94aff601017
- Loading branch information
1 parent
d62baad
commit bbff1bb
Showing
5 changed files
with
190 additions
and
1 deletion.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
src/compiler/__tests__/__generated__/useRefetchableFragment.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
97 changes: 97 additions & 0 deletions
97
src/compiler/__tests__/__generated__/useRefetchableFragmentRefetchQuery.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,19 @@ | ||
// @flow | ||
|
||
import { graphql } from '../../index'; | ||
|
||
it('generates and flow checks the fragment as expected', () => { | ||
// This is technically a Flow test (we are forcing generation of Relay artifacts). | ||
// Relay Compiler generated invalid artifacts for eager ES modules, see: | ||
// https://github.com/adeira/universe/issues/1975 | ||
|
||
graphql` | ||
fragment useRefetchableFragment on RootQuery | ||
@refetchable(queryName: "useRefetchableFragmentRefetchQuery") { | ||
# eslint-disable-next-line relay/unused-fields | ||
node(id: "my-id") { | ||
__typename | ||
} | ||
} | ||
`; | ||
}); |
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,5 @@ | ||
// @flow strict | ||
|
||
export default function createPrintRequireDefaultModuleDependency(): (string) => string { | ||
return (moduleName) => `require('./${moduleName}.js').default`; | ||
} |
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