Skip to content

Relay Compiler: Syntax error when compiling schemas with multiple inheritance #2364

Closed
@cousine

Description

@cousine

Given the following schema:

interface Invitable {
  avatar_url: String
  email: String
  github_nickname: String
  id: ID!
  name: String
}

interface Node {
  # ID of the object.
  id: ID!
}

type Student implements Node, Invitable {
  avatar_url: String
  email: String
  github_nickname: String
  id: ID!
  name: String
}

type Teacher implements Node, Invitable {
  avatar_url: String
  email: String
  github_nickname: String
  id: ID!
  name: String
}

Relay compiler would throw a syntax error Unexpected name Invitable, however, if I replace the , with & the schema would compile:

interface Invitable {
  avatar_url: String
  email: String
  github_nickname: String
  id: ID!
  name: String
}

interface Node {
  # ID of the object.
  id: ID!
}

type Student implements Node & Invitable {
  avatar_url: String
  email: String
  github_nickname: String
  id: ID!
  name: String
}

type Teacher implements Node & Invitable {
  avatar_url: String
  email: String
  github_nickname: String
  id: ID!
  name: String
}

Same issue can also be found here: https://stackoverflow.com/questions/49198778/relay-compiler-cannot-compile-graph-cool-graphql-schemas-with-multiple-inheritan

Info:

node@8.0.0
npm@5.6.0
relay-compiler@1.5.0
Schema auto generated via get-graphql-schema@2.1.1

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