zngly / wp-graphql-acf-mutations Goto Github PK
View Code? Open in Web Editor NEWWP GraphQl ACF Mutations Plugin
License: Other
WP GraphQl ACF Mutations Plugin
License: Other
please give me the documentation of mutating ACF repeater field with this plugin
Hey thanks for creating this great library. I was able to update a custom post type with a mutation and custom fields but it doesn't seem like it works for creating items. Does this plugin only work for using an update mutation?
I've got a custom post type =>
add_action('init', function () {
register_post_type('item', [
'public' => true,
'label' => 'Items',
'show_in_graphql' => true,
'graphql_single_name' => 'Item',
'graphql_plural_name' => 'Items'
]);
});
The update mutation updateItem allows me to update the custom fields on this type but createItem doesn't add the post correctly. The post is added but the custom fields aren't in the database.
This issue is regarding improvements to the graphql-acf-mutations custom implementation.
Given:
const SocialLinksQuery = graphql`
fragment SocialLinks_Fragment on ZnglyInfo {
znglyInfo {
socialLinks {
facebookLink
instagramLink
linkedinLink
pinterestLink
vimeoLink
twitterLink
youtubeLink
}
socialToggle
}
}
`;
const SocialLinksMutation = graphql`
mutation SocialLinks_Mutation(
$id: ID!,
$socialToggle: [String],
$facebookLink: String,
$instagramLink: String,
$linkedinLink: String,
$pinterestLink: String,
$vimeoLink: String,
$twitterLink: String,
$youtubeLink: String,
)
{
updateZnglyInfo(
input: {
id: $id,
socialToggle: $socialToggle,
socialLinks: {facebookLink: $facebookLink, instagramLink: $instagramLink, linkedinLink: $linkedinLink, pinterestLink: $pinterestLink, twitterLink: $twitterLink, vimeoLink: $vimeoLink, youtubeLink: $youtubeLink}
} ) {
znglyInfo {
znglyInfo {
socialLinks {
facebookLink
instagramLink
linkedinLink
pinterestLink
vimeoLink
twitterLink
youtubeLink
}
socialToggle
}
}
}
}
`;
The Acf fields should be grouped into an Input Type.
const SocialLinksMutation = graphql`
mutation SocialLinks_Mutation($id: ID!, $ZnglyInfoAcfInput: [String]) {
updateZnglyInfo(input: { id: $id, acf: $ZnglyInfoAcfInput }) {
znglyInfo {
...SocialLinks_Fragment
}
}
}
`;
This would
input: {
id,
title,
acf: {
acf_field_here,
etc...
}
}
Does this plugin support the function to mutate an ACF field that has been added to a user by default or does some modifications need to be made for this?
Hi
I would like to make use of the acf relationship field with the new bidirectional feature. So far it doesn't seems the be implemented in your plugin.
May it be possible that you can update your plugin so it can handle the bidirectional feature?
Kind regards
Thierry
Hello. Installed plugin, tested ACF mutation. It works fine for "Posts", "Pages", etc.
But I found that I cant mutate WooCommerce entities, such as "productCategory".
Here is example of mutation:
mutation MyMutation { updateProductCategory( input: {id: "dGVybTo2NDY=", enTitle: "EN title translation", enSeoTitle: "EN seo title translation"} ) { productCategory { enTranslation { enDescription enSeoDescription enSeoTitle enTitle } } } }
Request always returns default values.
"data": { "updateProductCategory": { "productCategory": { "enTranslation": { "enDescription": null, "enSeoDescription": null, "enSeoTitle": null, "enTitle": null } } } },
Is it possible to fix that? Thanks!
Hi
thanks for your work โ i'm curious to see how i may use it for my work. And i'm hoping wpgraphql will ad mutations by default to their plugin.
Problem now is that when i activate your plugin, my GraphiQL crashes. In the javascript console log there is an error showing:
"Introspection must provide input type for arguments, but received: [MediaItem]."
Found out the problem occurs when i have an acf gallery field active in my acf fieldset. Do you know why this error comes up?
The Plugin can't be installed via zip archive. The following error appears:
Error: Could not load WPGraphQL ACF Mutations. Please install the WPGraphQL ACF Mutations plugin via Composer.
composer install:prod
Wordpress: Version 6.0.3
Advanced Custom Fields PRO: Version 6.0.3
Advanced Custom Fields: Extended: Version 0.8.8.10
WP GraphQL: Version 1.12.0
WPGraphQL for Advanced Custom Fields: Version 0.5.3
Hi,
I'm running into a JS console error when trying to load the Graphiql-ide page in WP-admin after activating your plugin.
Requests to the API still seem to work properly.
Wordpress: Version 6.1 - RC3
Advanced Custom Fields PRO: Version 6.0.3
WP GraphQL: Version 1.12.0
WPGraphQL for Advanced Custom Fields: Version 0.6.1
WPGraphQL ACF Mutations: Version 1.1.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.