Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hsimah-services/wp-graphql-mb-relationships
WPGraphQL Provider for MB Relationships
https://github.com/hsimah-services/wp-graphql-mb-relationships
Last synced: 2 months ago
JSON representation
WPGraphQL Provider for MB Relationships
- Host: GitHub
- URL: https://github.com/hsimah-services/wp-graphql-mb-relationships
- Owner: hsimah-services
- License: mit
- Created: 2019-11-26T17:17:06.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-25T23:13:44.000Z (over 4 years ago)
- Last Synced: 2024-08-02T05:15:23.943Z (5 months ago)
- Language: PHP
- Size: 31.3 KB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-wordpress-gatsby - WPGraphQL MetaBox Relationships - This FREE plugin from @hsimah adds support for the [metabox.io](https://metabox.io/) Relationships field to WPGraphQL (when also using his wp-graphql-metabox plugin). (Plugins / WordPress)
README
# wp-graphql-mb-relationships
WPGraphQL Provider for MB RelationshipsThis is a simple WPGraphQL integration plugin for Meta Box Relationships. **It only supports post types at the moment.**
There are three new fields to add to the API configuration:
- `show_in_graphql` - a boolean to show the connection in the schema
- `graphql_name` - the name of the connection field in the schema
- `graphql_args` - the connection args (optional)
- `resolve` - the resolve handler (see WPGraphQL documentation) (experimental)
- `resolve_node` - the node resolve handler (see WPGraphQL documentaiton) (experimental)```
MB_Relationships_API::register( [
'id' => 'linked_posts',
'from' => array(
'show_in_graphql' => true,
'graphql_name' => 'goingUp',
'graphql_args' => [
'higher' => [
'type' => 'Boolean',
'description' => 'Field Description',
],
],
'object_type' => 'post',
'post_type' => 'mypost',
'meta_box' => [
'title' => 'Going Up!',
'context' => 'side',
],
],
'to' => [
'show_in_graphql' => true,
'graphql_name' => 'goingDown',
'object_type' => 'post',
'post_type' => 'mypost',
'meta_box' => [
'title' => 'Going Down!',
'context' => 'side',
'empty_message' => 'None',
],
],
]
);
```