prisma-labs / graphql-framework-experiment

Code-First Type-Safe GraphQL Framework
https://nexusjs.org
MIT License
673 stars 66 forks source link

TS error with inputObjectType default value when using with list=true #1379

Open pengx17 opened 4 years ago

pengx17 commented 4 years ago

Screenshot

image

Description

The TypeScript definitions for inputObjectType gives false result for default when using it as a list.

Repro

export const Bar = inputObjectType({
  name: 'Bar',
  definition(t) {
    t.string('someField');
  },
});

export const getFoo = queryField('getFoo', {
  type: 'String',
  args: {
    bar: arg({
      type: 'Bar',
      list: true,
      default: [], <<< Error
    }),
  },
});