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

fix(mutations): nullable payloads, rollback individual mutations on error #59

Merged
merged 7 commits into from
Sep 22, 2017

Conversation

benjie
Copy link
Member

@benjie benjie commented Aug 24, 2017

Wraps each mutation in a transaction, automatically rolling back so that a) results of previous mutations are not invalidated (see #75) and b) future mutations are not prevented.

Fixes graphile/crystal#563
Fixes #75

@benjie
Copy link
Member Author

benjie commented Sep 11, 2017

From graphile/crystal#563 (comment):

The error only happens with missing grants:

CREATE OR REPLACE FUNCTION public.test() RETURNS boolean LANGUAGE 'sql' AS $func$ SELECT true $func$;
REVOKE EXECUTE ON FUNCTION public.test() FROM PUBLIC;
mutation regression {
  test(input: {}) {
    clientMutationId
    boolean
  }
}
{
  "data": null, // <---
  "errors": [
    {
      "message": "permission denied for function test",
      "locations": [
        {
          "line": 29,
          "column": 3
        }
      ],
      "path": [
        "test"
      ]
    }
  ]
}

@benjie benjie changed the title test(permissions): test for forbidden delete fix(mutations): handle errors better Sep 22, 2017
@benjie benjie changed the title fix(mutations): handle errors better fix(mutations): nullable payloads, rollback individual mutations on error Sep 22, 2017
@benjie benjie merged commit 4d00257 into master Sep 22, 2017
@benjie benjie deleted the permission-denied branch September 22, 2017 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant