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

GraphQLError: Syntax Error: Unexpected Name "wordpress__complianz" #20981

Closed
kosvrouvas opened this issue Jan 29, 2020 · 7 comments
Closed

GraphQLError: Syntax Error: Unexpected Name "wordpress__complianz" #20981

kosvrouvas opened this issue Jan 29, 2020 · 7 comments
Labels
topic: GraphQL Related to Gatsby's GraphQL layer topic: source-wordpress Related to Gatsby's integration with WordPress

Comments

@kosvrouvas
Copy link
Contributor

kosvrouvas commented Jan 29, 2020

Hi, we just installed the complianz.io plugin on our production website (standard WordPress) and we are getting an error when building our GatsbyJS development site.

`success Downloading remote files - 149.064s - 457/520 3.49/s
success source and transform nodes - 164.366s
⠙ building schema

ERROR

UNHANDLED REJECTION Syntax Error: Unexpected Name "wordpress__complianz"

GraphQLError: Syntax Error: Unexpected Name "wordpress__complianz"

  • TypeMapper.js:113 TypeMapper.createType
    [gatsby-saig]/[graphql-compose]/lib/TypeMapper.js:113:43

  • ObjectTypeComposer.js:80 Function.createTemp
    [gatsby-saig]/[graphql-compose]/lib/ObjectTypeComposer.js:80:28

  • ObjectTypeComposer.js:56 Function.create
    [gatsby-saig]/[graphql-compose]/lib/ObjectTypeComposer.js:56:21

  • index.js:59
    [gatsby-saig]/[gatsby]/dist/schema/infer/index.js:59:41

  • Array.forEach

  • index.js:42 addInferredTypes
    [gatsby-saig]/[gatsby]/dist/schema/infer/index.js:42:13

  • schema.js:184 updateSchemaComposer
    [gatsby-saig]/[gatsby]/dist/schema/schema.js:184:9

  • schema.js:95 async buildSchema
    [gatsby-saig]/[gatsby]/dist/schema/schema.js:95:3

  • index.js:136 async Object.build
    [gatsby-saig]/[gatsby]/dist/schema/index.js:136:18

  • index.js:419 async module.exports
    [gatsby-saig]/[gatsby]/dist/bootstrap/index.js:419:3

  • develop.js:422 async module.exports
    [gatsby-saig]/[gatsby]/dist/commands/develop.js:422:7

⠙ building schema`

Is there a way to remove complianz from GraphQL?

@pieh pieh added topic: GraphQL Related to Gatsby's GraphQL layer topic: source-wordpress Related to Gatsby's integration with WordPress labels Jan 29, 2020
@pieh
Copy link
Contributor

pieh commented Jan 29, 2020

I think this falls into similar category as #20596 (not exactly the same, but type name provided by plugin seems to fail validation)

This type name is also auto generated by wordpress plugin (similar as in the issue I linked)

/cc @vladar

@vladar
Copy link
Contributor

vladar commented Jan 29, 2020

@pieh Yeah, it is highly likely that type name contains space here (like: wordpress__complianz something) so it fails type name validation.

@vladar
Copy link
Contributor

vladar commented Jan 29, 2020

@TylerBarnes any idea how can we override bad type names coming from gatsby-source-wordpress? I don't think we can fix this using schema customization.

@kosvrouvas
Copy link
Contributor Author

Although it doesn't solve this, I was able to get around it sourcing data via wpgraphql.

@TylerBarnes
Copy link
Contributor

@vladar, I'm sure there's a way but it would be decently complex and site-specific. A custom normalizer could be used to rename the problematic typenames but it would likely need to be a recursive script that could get expensive. I'm glad we'll be deprecating using Gatsby and the REST API, because there are many problems like this that we can't reasonably account for on our side that are inherent to using an untyped REST API. I would say the best way around this right now is to use gatsby-source-graphql with WPGraphQL like you're doing @kosvrouvas. Good news about that is that the new major version of gatsby-source-wordpress will be more similar to gatsby-source-graphql/WPGraphQL than it is to the current version of gatsby-source-wordpress, so upgrading from that will be easier for you anyway @kosvrouvas.

@github-actions
Copy link

github-actions bot commented Mar 2, 2020

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Mar 2, 2020
@kosvrouvas kosvrouvas added not stale and removed stale? Issue that may be closed soon due to the original author not responding any more. labels Mar 3, 2020
@TylerBarnes
Copy link
Contributor

Closing this as it's an issue with gatsby-source-wordpress v3 which we aren't actively developing anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: GraphQL Related to Gatsby's GraphQL layer topic: source-wordpress Related to Gatsby's integration with WordPress
Projects
None yet
Development

No branches or pull requests

5 participants