Skip to content

Unknown directive "@namespace" error #6913

Closed
@185driver

Description

@185driver

New Issue Checklist

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',
  },
);
  1. Initialize a ParseServer using the code found in @davimacedo 's PR found at GraphQL Custom Schema #5821 (comment)
  2. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions