Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Graphql or Rest API Mutation Support #238

Closed
michael-alexcan opened this issue Mar 23, 2021 · 2 comments
Closed

Graphql or Rest API Mutation Support #238

michael-alexcan opened this issue Mar 23, 2021 · 2 comments
Labels

Comments

@michael-alexcan
Copy link

Hello,
Thank you so much for this powerful plugin that is going to change the internet with the power of #graphql .

It seems that the limitation of the Advance Custom Fields and the Advance Custom Fields Pro not allowing Mutation which mean that none of the Custom fields are updatable throw the graphql that makes it a Read only Custom Fields..

I have managed to hire a developer and he managed to get the Advance Custom Fields to update throw a custom endpoint using the Export to PHP that comes with Advance Custom Fields Plugin.

I Also noted that Pods – Custom Content Types and Fields for WordPress supports Read and Write using regular Rest API.

With that in mind when do we expect Mutation for Advance Custom Fields and Graphql?

Thank you

@colmobildev
Copy link

It's a high-demand feature!!

@jasonbahl
Copy link
Contributor

👋🏻 Currently we don't plan to officially support mutations for a few reasons:

Access Control

We believe there needs to be a lot more work on the core ACF side to define access control. What fields can be edited by what users (which capabilities, etc)

Of course, WPGraphQL could solve this to some degree, but we believe it's a more central issue as fields could be edited in the admin UI, CLI, REST, GraphQL, etc, so core ACF should provide more ways to formally lock down which fields can/cannot be modified by certain users.

GraphQL oneOf Directive / Input Unions

GraphQL has the concept of Unions and Interfaces for queries, which allows the response to return "one of" many possible types.

For example, we can query contentNode and get "one of" the many Types that represent a WordPress Post Type (Page, Post, etc)

Or we can query nodeByUri() and get "one of" the many possible Types that can be accessed by a uri (Post, Page, User, Category, Tag, etc)

When it comes to inputting data, GraphQL does not (yet) support the concept of inputting "one of" many different possible types.

This is a critical feature, in our mind, to be able to properly support mutations for ACF because the Types of data that can be input could easily be "one of" many different Types. Especially, but certainly not limited to, when inputting data for field Types such as Flexible Content would be needed.

The GraphQL Spec currently has an RFC open for this concept: graphql/graphql-spec#825

Until this feature becomes part of the GraphQL Spec ,and then GraphQL-PHP, and then WPGraphQL, we will not be officially supporting GraphQL mutations for ACF.


I've opened the following issue (wp-graphql/wpgraphql-acf#109) on the new repo where we're re-building WPGraphQL for ACF where we can track this, as it is something we want to address at some point., but because this repo will be archived in the not-too-distant future, we won't be working on it in this repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants