Closed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
Issue Description
An error is thrown on build if I use the @namespace directive in custom schema.
Steps to reproduce
const parseGraphQLServer = new ParseGraphQLServer(
parseServer,
{
graphQLPath: '/graphql',
graphQLCustomTypeDefs: gql`
extend type Query {
custom: Custom @namespace
}
type Custom {
hello: String @resolve
}
`,
playgroundPath: '/playground',
},
);
- Initialize a ParseServer using the code found in @davimacedo 's PR found at GraphQL Custom Schema #5821 (comment)
- Open the GraphQL API console. The error will be logged in the dev console.
Actual Outcome
An Unknown directive "@namespace"
error in the console.
Expected Outcome
I thought it would not error out.
Environment
Server
- Parse Server version:
4.30
- Operating system:
Win 10
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
localhost
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
4.2.8
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
MongoDB Atlas
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
JS
- SDK version:
Cloud Code
Logs
error: Error: Unknown directive "@namespace".
at assertValidSDLExtension (C:\Mypath\node_modules\graphql\validation\validate.js:124:11)
at Object.extendSchema (C:\Mypath\node_modules\graphql\utilities\extendSchema.js:77:43)
at extensions.forEach.extension (C:\Mypath\node_modules\@graphql-tools\stitch\index.cjs.js:862:28)
at Array.forEach (<anonymous>)
at stitchSchemas (C:\Mypath\node_modules\@graphql-tools\stitch\index.cjs.js:861:16)
at ParseGraphQLSchema.load (C:\Mypath\node_modules\parse-server\lib\GraphQL\ParseGraphQLSchema.js:212:56)
at process._tickCallback (internal/process/next_tick.js:68:7)