Giter Club home page Giter Club logo

wp-graphql-meta's Introduction

Alright ๐Ÿ‘‹

Rob's github stats

  • ๐Ÿš€ Working as a principal engineer and lead on Altis DXP at Human Made
  • ๐Ÿ“ˆ Learning about data science (ML anyone?)
  • ๐Ÿง—โ€โ™‚๏ธ Love climbing
  • ๐Ÿ’ฌ Ask me about WordPress, React, Analytics
  • โšก๏ธ Check out my most recent side project buzby.app
  • ๐Ÿ‘จโ€๐Ÿ’ป How I work

wp-graphql-meta's People

Contributors

roborourke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wp-graphql-meta's Issues

Does not work for custom post types?

Hi,

Firstly, great little plugin.

I was having trouble adding a meta field for a custom post type. After some debugging, I found that the plugin is being loaded before the custom post types are.

Issue
The plugin instantiates on graphql_init, which I think is the locigal place to hook in. However, wp-graphql instantiates on after_setup_theme, which is before custom post types are added on the init hook.
https://codex.wordpress.org/Plugin_API/Action_Reference

So even though you register your meta field through the register_meta function, it won't get added because the post type hasn't been added yet.

Solution
Moving the plugin to load on do_graphql_request instead of graphql_init seems to do the trick. I'm unaware of any side effects by doing this, if there are any.

I would sugget to either move the plugin to load on do_graphql_request. If this is not a good solution please let me know and I'll prepare a PR for wp-graphql with solution for a second hook that fires on init.

Regards,
Rasmus

Not loading shema in IDE

Once I activate the plugin, the wp_graphql IDE won't load its schema.

/index.php?gql:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
invariant.mjs:6 Uncaught (in promise) Error: Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: { status: 500 }
    at r (invariant.mjs:6)
    at r (buildClientSchema.mjs:27)
    at App.js:181

WordPress 5.6
WP GraphQL 1.0.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.