Skip to content

Import interfaces from source schema #71

Description

@pmelab

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions