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

Add support for schema extensions #16

Open
tomfa opened this issue May 5, 2022 · 0 comments · May be fixed by #17
Open

Add support for schema extensions #16

tomfa opened this issue May 5, 2022 · 0 comments · May be fixed by #17

Comments

@tomfa
Copy link

tomfa commented May 5, 2022

When running the formatter against schemas with extension, the following error is displayed:

***/app/node_modules/format-graphql/dist/utilities/formatSdl.js:30
      return a.name.value.localeCompare(b.name.value);
                                               ^

TypeError: Cannot read properties of undefined (reading 'value')
    at ***/app/node_modules/format-graphql/dist/utilities/formatSdl.js:30:48
    at Array.sort (<anonymous>)
    at sortSchema (***/app/node_modules/format-graphql/dist/utilities/formatSdl.js:20:26)
    at walkAST (***/app/node_modules/format-graphql/dist/utilities/formatSdl.js:83:15)
    at formatSdl (***/app/node_modules/format-graphql/dist/utilities/formatSdl.js:90:30)
    at Object.<anonymous> (***/app/node_modules/format-graphql/dist/bin/index.js:52:44)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
error Command failed with exit code 1.

Example schema:

extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"])

type GenericResponse @shareable {
  message: String
  success: Boolean!
}
@tomfa tomfa linked a pull request May 5, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant