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

config rules do not match TypeScript types for requiring schema property #1031

Open
asakusuma opened this issue Apr 11, 2022 · 0 comments
Open

Comments

@asakusuma
Copy link

asakusuma commented Apr 11, 2022

Describe the bug

The JSON config rules for the schema technically do not require the schema field: https://github.com/kamilkisiela/graphql-config/blob/master/src/project-config.ts#L21

This is technically a legal config:

{
  "schemaPath":"foo",
  "projects":{
    "myproject": {
      "documents":["foo"]
    }
  }
}

But the types assume that every project has a defined schema field:
https://github.com/kamilkisiela/graphql-config/blob/master/src/types.ts#L53

I also don't think the JS API also has no way of accessing the schemaPath field. As their is no default project here AND project.getSchemaSync() doesn't work here.

To Reproduce
Steps to reproduce the behavior:

https://www.jsonschemavalidator.net/s/fbNGYrz8

I would not expect this config to be valid based on the typescript types

Environment:

  • OS:
  • GraphQL Config Version:
  • NodeJS:

Additional context

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