Giter VIP home page Giter VIP logo

wp-graphql-acf-mutations's Issues

feat: Input Types

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

  • reduce bloat input fields
  • point all the acf inputs to a single entry point: acf
  • avoid duplicate acf field key and original input keys
input: {
    id,
    title,
    acf: {
        acf_field_here,
        etc...
    }
}

WPGraphQL WooCommerce + ACF Mutation

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!

Does this work for creating items?

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.

write into acf fields in taxonomy or user

Hi

i am trying to mutate a text acf field inside a taxonomy (field calles jobNumber) and also inside a user. For both of these post types, it does not work.

In the case of taxonomy though, when i write into the standard description field, that works perfect. Can you take a look into that?

mutation MyMutation {
  createJob(input: {name: "test", jobNumber: "abc", description: "xyz"}) {
    clientMutationId
  }
}


ACF relationship bidirectional possible?

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

Error when plugin is active

Hi,

thx for the plugin ! i have error when i activate the plugin (probably because i use new plugin for ACF wpgraphql idk)
For fix the error you need to change in src config.php

use WPGraphQL\ACF\LocationRules;
to
use WPGraphQL\Acf\LocationRules\LocationRules;

And after AcfLink make also a problem i have comment this case in the same file.

Error in GraphiQL with acf gallery field

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?

Mutate and query for acf relationship field

Hi

i'm trying to find out how to query and mutate acf relationship fields. But as soon as i create a relationship field, i do get this error in the GraphiQL IDE:

Bildschirmfoto 2024-02-14 um 10 35 24

Do i have to create a new input type? How to do that?

Thanks for help!

Graphiql-ide page not loading after activating the plugin

Hi,

I'm running into a JS console error when trying to load the Graphiql-ide page in WP-admin after activating your plugin.

SCR-20221026-j8m

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

Can't be installed via zip archive

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.