Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compileGatsbyFragments: cannot use __typename on field of interface type #15

Open
vladar opened this issue Sep 30, 2020 · 0 comments
Open

Comments

@vladar
Copy link
Contributor

vladar commented Sep 30, 2020

Say we have the following custom fragment:

fragment Example on MyInterface {
  __typename
  someField
}

The compileNodeQueries will transform it to something like this for node query:

fragment Example on MyInterface {
  remoteTypeName: __typename
  someField
}

And compileGatsbyFragments will transform it to:

fragment Example on PrefixMyInterface {
  remoteTypeName
  someField
}

The problem though is that the field remoteTypeName is not added to PrefixMyInterface and as a result, Gatsby query fails with an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant