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

WPGraphQL Support #1449

Open
james0r opened this issue Mar 13, 2022 · 3 comments
Open

WPGraphQL Support #1449

james0r opened this issue Mar 13, 2022 · 3 comments

Comments

@james0r
Copy link

james0r commented Mar 13, 2022

Not seeing any out there to be able to expose CMB2 fields with the WPGraphQL plugin. Is there any plan for this?

@tw2113
Copy link
Contributor

tw2113 commented Mar 13, 2022

CMB2 doesn't do anything out of the ordinary, it stores everything n standard post/term/user meta and options. As long as you can add meta to WPGraphQL output, you can do so with the fields saved with CMB2

@james0r
Copy link
Author

james0r commented Mar 13, 2022

I added a test box & field to a page and I'm seeing it in the Pages REST API, but after adding https://github.com/roborourke/wp-graphql-meta I'm still not seeing it anywhere in the GraphiQL IDE though.

@tw2113
Copy link
Contributor

tw2113 commented Mar 14, 2022

Out of curiosity, have you tried setting up the example code from that link's readme, to match up with your pots type and meta keys?

For example, if I had a movie post type and a release year custom field:

register_meta( 'movie', 'release_year', array(
    'type' => 'string', 
    'description' => 'Release Year',
    'single' => true,
    'show_in_rest' => true,
) );

It very much may be a case of you need to do this for each field you want available.

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

2 participants