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

[Question] Not working with custom post types #4

Closed
rtsilva-daitan opened this issue May 28, 2019 · 5 comments
Closed

[Question] Not working with custom post types #4

rtsilva-daitan opened this issue May 28, 2019 · 5 comments

Comments

@rtsilva-daitan
Copy link

rtsilva-daitan commented May 28, 2019

I've created a CPT named News, I've set support to editor, show_in_graphql, show_in_rest.
All working with graphql. But when query blocks I get Cannot query field \"blocks\" on type \"News\".

Is there any setting I may have forgotten?

@CHEWX
Copy link

CHEWX commented Jun 7, 2019

Hi,

Are they named the same?

What's your register_post_type( 'xxx', $args ); and graphql_single_name' => 'xxx' values set to? If they are different it won't work.

Thanks,
Tom

@pristas-peter
Copy link
Owner

@rtsilva-daitan Sorry I have missed the PR notification so I'm responding late. Yes @CHEWX is right. Should fix that though.

@CHEWX
Copy link

CHEWX commented Jun 7, 2019

@pristas-peter If possible as I personally set my register to cpt_xxx and then graphql_single_name to xxx.

@rtsilva-daitan
Copy link
Author

rtsilva-daitan commented Jun 7, 2019

@CHEWX @pristas-peter Yeah, I haven't notice that. My graphql_single_name wasn't capitalized 🤦‍♂️

Thank you guys

@CHEWX
Copy link

CHEWX commented Jun 11, 2019

I'm not sure this should be closed, it's a bug really. wpgraphql doesn't have this stipulation of matching post type name, nor should this as it doesn't give flexibility to the developer and mistakes will be made easily.

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

3 participants