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

Import interfaces from source schema #71

Open
pmelab opened this issue Jul 12, 2022 · 0 comments
Open

Import interfaces from source schema #71

pmelab opened this issue Jul 12, 2022 · 0 comments

Comments

@pmelab
Copy link

pmelab commented Jul 12, 2022

Is it possible to define an interface in my source schema and properly reflect it in the Gatsby schema?

Example:

interface Person {
  name: String!
}

type Employee implements Person {
  name: String!
  department: String!
}

type Client implements Person {
  name: String!
  company: String!
}

Both Employee and Client are nodes that are sourced to Gatsby, but the interface is dropped entirely. If a field returns the Person type, the interface will be created and correctly applied to Employee and Client, but it won't contain any fields except remoteTypeName.

I would be great to be able to run a reusable fragment against an interface:

fragment Person {
  name
}

But if i'm not mistaken, this is not possible right now?

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