Skip to content

Interfaces that implement other interfaces #164

@jmatichard

Description

@jmatichard

Hello genqlient team !

We are trying to generate queries from a GraphQL schema that contains interfaces that implements other interfaces.

According to the GraphQL specs, this should be valid (cf. issue #373 in the GQL repository).

Here is our (simplified) schema:

scalar DateTime

interface BaseEntity {
  id: String!
  createdAt: DateTime!
  updatedAt: DateTime!
}

interface Transaction implements BaseEntity {
  id: String!
  createdAt: DateTime!
  updatedAt: DateTime!
  userId: String!
  productId: String!
}

and the genclient.yaml config:

schema: schema.graphql
operations:
  - genqlient.graphql
generated: generated.go
package: main
bindings:
  DateTime:
    type: time.Time

When we the run the go run github.com/Khan/genqlient command, we get the following error message:

schema.graphql:9: invalid schema file schema.graphql: Unexpected Name "implements"

Can you please confirm that genqlient doesn't currently support this feature ?

Do you have some hints so we can help implement this in the codebase ?

Thank you very much for your hard work on this Go library !

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions