Skip to content

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

@lordnox

Description

@lordnox

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)

Metadata

Metadata

Assignees

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