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

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

Open
pengx17 opened this issue Aug 24, 2020 · 0 comments
Open

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

pengx17 opened this issue Aug 24, 2020 · 0 comments
Labels
type/bug Something is not working the way it should

Comments

@pengx17
Copy link

pengx17 commented Aug 24, 2020

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
    }),
  },
});
@pengx17 pengx17 added the type/bug Something is not working the way it should label Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is not working the way it should
Projects
None yet
Development

No branches or pull requests

1 participant