Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default GraphQL mutations on Versioned object write to Live stage with no clear way to change that #403

Open
blueo opened this issue Mar 14, 2023 · 1 comment

Comments

@blueo
Copy link

blueo commented Mar 14, 2023

If I set up a scaffolded mutation on a versioned object (on a 'default' schema) such as:

SilverStripe\CMS\Model\SiteTree:
  fields: '*'
  operations: '*'

which gives me an updateSiteTree mutation. This mutation will write directly to the Live stage and there doesn't appear to be any option to write to Draft.

an example mutation would be:

mutation update($input: UpdateSiteTreeInput!) {
  updateSiteTree(input:$input) {
    id,
    title
  }
}
{
  "input":
  {"id":1, "title": "test update 2" }
}

I couldn't quite tell if this was intentional and extra config was required or if it was a bug? I assume writing to draft is supported in mutations.

tested on v5.0.0-beta2 but I believe it happens on v4 too

@lars-lemon8
Copy link

Yes, can confirm this happens on v4 as well.

@GuySartorelli GuySartorelli changed the title Default mutations on Versioned object write to Live stage Default GraphQL mutations on Versioned object write to Live stage with no clear way to change that Apr 10, 2023
@GuySartorelli GuySartorelli transferred this issue from silverstripe/silverstripe-graphql Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants