Comments (4)
What are you expecting when adding them to admin_cols
? For a true/false value to show up in the Post list screen?
In any case, I don't think this is related to Poet.
from poet.
We have a custom post type called "release" that we have flagged to 'show_in_graphql' as shown below. This successfully adds the custom post type to the GQL schema. Everything works there.
'post' => [
'release' => [
'supports' => ['title', 'thumbnail'],
'show_in_rest' => true,
'labels' => [
'singular' => 'Release',
'plural' => 'Releases',
],
'admin_cols' => [...]
],
'show_in_graphql' => true,
'graphql_single_name' => 'release',
'graphql_plural_name' => 'releases',
],
However, each custom field that you want exposed to the GQL schema also needs to be explicitly added. The documentation shows this being done as the field group is added to ACF. I'm not sure if/how this might map into poet. I tried adding it into the admin_cols section both as an attribute of admin_cols, and as attributes of a give field and neither one worked. My goal is to see the custom fields (in this example case "artist") in the GQL schema, so I could query them like so:
query GetPosts { releases { nodes { artist } } }
'admin_cols' => [
'artist' => ['post_field' => 'artist',
'meta_key' => 'artist',
'show_in_graphql' => true,
'graphql_field_name' => 'artist_group',],
...
],
'show_in_graphql' => true,
'graphql_field_name' => 'admin_cols',
],
from poet.
Sorry for the late reply.
This wouldn't be related to Poet. admin_cols
simply lets you add more columns to the list of posts in the backend.
You need to add show_in_graphql
to your field group its self when registering it.
If you're using ACF Composer, you can do it when you initialize FieldsBuilder like this:
$example = new FieldsBuilder('example', [
'show_in_graphql' => true,
'graphql_field_name' => 'My field name',
]);
from poet.
We ended up calling register_graphql_fields
and acf_add_local_field_group
and register_post_type
in setup.php. Less concise, but it worked!
from poet.
Related Issues (20)
- Gutenberg Block Category
- I'm drafting something up
- WordPress 5.8 block_categories deprecated HOT 1
- Shouldn't add_filter be add_action? HOT 4
- Renaming default 'post' post_type HOT 3
- The custom block is not working HOT 4
- compatibility with acorn and sage 10 beta 3 HOT 1
- Unable to modify default 'category' taxonomy HOT 1
- $content is empty when the only content is an img HOT 2
- Unable to publish the config/poet.php HOT 1
- Registered block not available in block library HOT 5
- Translating post type label and slug HOT 18
- Manually publish HOT 2
- Query vars not working aside post_types archives pages HOT 1
- Check pattern content before return pattern blade view
- Error including functions in config file HOT 2
- Can not register post type again when move code to server or pull code to another devices HOT 7
- Callback for custom fields in CPT HOT 2
- taxonomies defined by poet aren't available to acf-composer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poet.