Cms: FR: GraphQL support on Mutation

Created on 28 Aug 2019  路  9Comments  路  Source: craftcms/cms

Description

Before Craft 3.3, we use CraftQL for both Query and Mutation on

  • Entries
  • Globals
  • Categories
  • Tags

Now with 3.3 release, the native GraphQL seems only support viewing on those data types which will break our integration if we upgrade, and there is no way for us to install the CraftQL plugin anymore in the latest 3.3 version due to conflicts with natively supported GraphQL server.

Please support GraphQL Mutation soon on those above data types, so we can migrate over to latest version and remove all existing CraftQL usage.

Additional info

  • Craft version: 3.3
enhancement graphql

Most helpful comment

Excited to say that mutations will be making it into Craft 3.5! 馃帀

An example GraphQL mutation query along with its response

If you want to help test, you can start right now by changing your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "3.5.x-dev",
  "...": "..."
}

Then run composer update.

Currently mutations are purely allowed or disallowed per the schema settings. We will be adding an additional runtime authorization layer in Craft 4, pending a move to RBAC-based authorization (#1646).

All 9 comments

@minyangu-bgl it's definitely in the plans to add it as soon as possible.

CraftQL 1.3.3 is out now which fixes the dependency conflict with Craft 3.3, so you should be able to update that now.

Good one, @brandonkelly

And it works -- now I just have to get Hal to be kind about whether you've got either of them available and ready to play...!

1.3.3 indeed fixed the dependency issue during installation which is great. However, I am now experiencing below issue:
"error": "Class 'GraphQL\Type\Definition\DirectiveLocation' not found"
}

It appear on both Craft CMS 3.2/3.3, rolling back from 1.3.3 back to 1.3.2 will make things back to normal. So unfortunately, I can not upgrade Craft CMS to 3.3 unless CraftQL fixes this issue.

Here is the raised bug ticket on CraftQL: https://github.com/markhuot/craftql/issues/312

@andris-sevcenko Any sense of when (or if) support for mutations will make it into an upcoming release? I'm pleased to see CraftQL is now compatible with Craft 3.3, and that'll be a more than adequate stop-gap, but I am looking forward to utilizing your new native graphQL features.

I just added the 4.0 milestone. It's definitely not a thing that can be rushed, so it won't make the cut for 3.4.

Excited to say that mutations will be making it into Craft 3.5! 馃帀

An example GraphQL mutation query along with its response

If you want to help test, you can start right now by changing your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "3.5.x-dev",
  "...": "..."
}

Then run composer update.

Currently mutations are purely allowed or disallowed per the schema settings. We will be adding an additional runtime authorization layer in Craft 4, pending a move to RBAC-based authorization (#1646).

Mutation docs are now up in the 3.5 branch: https://github.com/craftcms/docs/blob/3.5/graphql.md#mutations

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattstein picture mattstein  路  3Comments

michaelhue picture michaelhue  路  3Comments

michel-o picture michel-o  路  3Comments

richhayler picture richhayler  路  3Comments

mccombs picture mccombs  路  3Comments