wp-graphql-acf icon indicating copy to clipboard operation
wp-graphql-acf copied to clipboard

How to expose custom acf field to wp-graphql?

Open ShahriarKh opened this issue 2 years ago • 2 comments

I installed this extension (https://github.com/ildrm/acf-jalalidatepicker) to add a custom datepicker to ACF. This is working fine, but I don't know how to enable the "Show in GraphQl" thing like other fields. Any help is appreciated! 😸

image

ShahriarKh avatar Mar 10 '22 13:03 ShahriarKh

@ShahriarKh Did you manage to resolve this? Got any tips?

raulclaudino avatar May 27 '22 22:05 raulclaudino

@raulclaudino Unfortunately, not yet.

ShahriarKh avatar May 28 '22 18:05 ShahriarKh

I would love to get some help on this matter. I can't find documentation on what to add to my custom field for it to be found in Graphql Schema

macojaune avatar Sep 27 '22 00:09 macojaune

I also need to add a custom field. Been struggling to find a solution.

robmarshall avatar Oct 21 '22 16:10 robmarshall

👋🏻 We're re-building this plugin over here: https://github.com/wp-graphql/wpgraphql-acf and in the new version we have a new API for mapping ACF Field Types to the GraphQL Schema.

The new version of the plugin has built-in support for ACF Extended (free and PRO), which uses the new API for mapping custom ACF Field Types to the GraphQL Schema.

It's not fully documented yet, but you can see plenty of examples of using the new register_graphql_acf_field_type() API in this directory: https://github.com/wp-graphql/wpgraphql-acf/tree/main/src/ThirdParty/AcfExtended

Here's also a GIST showing how @CesarBenavides777 mapped the ACF Table field type to the GraphQL Schema: https://gist.github.com/CesarBenavides777/79b158db8355ddbc349fbf9b3272ae47

jasonbahl avatar Oct 31 '23 15:10 jasonbahl