Skip to content

feature request: support of GraphQL interfaces #855

@gauthiermyr

Description

@gauthiermyr

Currently envio does not support the use of interfaces in the GraphQL schema (see: https://graphql.org/learn/schema/#interface-types).

Interfaces allow this type of data structure and help in indexing entities with a generic structure and contracts with inheritance

Example:

interface ITest {
  id: ID!
  common: String!
}

type TestA implements ITest {
  id: ID!
  common: String!

  a: String!
}

type TestB implements ITest {
  id: ID!
  common: String!

  b: String!
}

type Entity {
  id: ID!

  test: ITest
}

query getEntity($id: ID!) {
  entity(id: $id) {
    id
    test {
      common
      ... on TestA {
        id
        a
      }
      ... on TestB {
        id
        b
      }
    }
  }
}

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