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

Error: Interface field List.nodes expects type [Node!]! but Users.nodes is type [User!]!. #23

Open
lordnox opened this issue May 23, 2019 · 1 comment
Assignees

Comments

@lordnox
Copy link
Collaborator

lordnox commented May 23, 2019

Error using interfaces

const paginate = <Type>(data: Type[]): Paged<Type> => ({
  nodes: data,
  page: {
    limit: data.length,
    offset: 0,
  },
})

const anyService = ({
  create: async () => null,
  update: async () => null,
  remove: async () => null,
  findOne: async () => null,
  findMany: async () => paginate([]),
})

const interfaceService = ({
  findOne: async () => null,
  findMany: async () => paginate([]),
})

export const builder = createSchemaBuilder()

const touchpoint = builder.model('Touchpoint', wrapModel(Touchpoints))
touchpoint.attr('name', GraphQLString)

const user = builder.interface('User', interfaceService)
user.attr('email', GraphQLString)

const apiKeys = builder.model('ApiKey')
apiKeys.attr('publicKey', GraphQLString)
apiKeys.attr('privateKey', GraphQLString)

const developer = builder.model('Developer', anyService).interface('User')
developer.attr('apiKeys', apiKeys)
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