Permalink
Browse files

Fix #4, add clientMutationId.

  • Loading branch information...
dblock committed Jul 10, 2018
1 parent 8e78fda commit bf4a89d2a53d2404a7a341bd8660f7873e8a2029
@@ -1,9 +1,9 @@
{
"presets": ["babel-preset-expo"],
"plugins": ["relay"],
"env": {
"development": {
"plugins": [
["relay", { "schema": "schema/schema.graphql" }],
"transform-react-jsx-source"
]
}
@@ -1,9 +1,11 @@
import { graphql } from 'react-relay'
import commitMutation from 'relay-commit-mutation-promise'
import { graphql } from 'react-relay';
import commitMutation from 'relay-commit-mutation-promise';
import uuid from 'uuid/v4';

const mutation = graphql`
mutation CreateMeetingMutation($input: createMeetingInput!) {
createMeeting(input: $input) {
clientMutationId,
meeting {
id
title
@@ -20,7 +22,12 @@ const mutation = graphql`
`

function commit(userId, { environment, input }) {
const variables = { input }
const variables = {
input: {
clientMutationId: uuid(),
...input
}
}

return commitMutation(environment, {
mutation,
@@ -1,9 +1,11 @@
import { graphql } from 'react-relay'
import commitMutation from 'relay-commit-mutation-promise'
import uuid from 'uuid/v4';

const mutation = graphql`
mutation CreateUserMutation($input: createUserInput!) {
createUser(input: $input) {
clientMutationId,
user {
id
}
@@ -12,7 +14,12 @@ const mutation = graphql`
`

function commit({ environment, input }) {
const variables = { input }
const variables = {
input: {
clientMutationId: uuid(),
...input
}
}

return commitMutation(environment, {
mutation,
@@ -1,16 +1,23 @@
import { graphql } from 'react-relay'
import commitMutation from 'relay-commit-mutation-promise'
import uuid from 'uuid/v4';

const mutation = graphql`
mutation DeleteMeetingMutation($input: deleteMeetingInput!) {
deleteMeeting(input: $input) {
clientMutationId,
deletedId
}
}
`

function commit(userId, { environment, input }) {
const variables = { input }
const variables = {
input: {
clientMutationId: uuid(),
...input
}
}

return commitMutation(environment, {
mutation,
@@ -1,9 +1,11 @@
import { graphql } from 'react-relay'
import commitMutation from 'relay-commit-mutation-promise'
import uuid from 'uuid/v4';

const mutation = graphql`
mutation LoginMutation($input: loginInput!) {
login(input: $input) {
clientMutationId,
user {
id
}
@@ -12,7 +14,12 @@ const mutation = graphql`
`

function commit({ environment, input }) {
const variables = { input }
const variables = {
input: {
clientMutationId: uuid(),
...input
}
}

return commitMutation(environment, {
mutation,
Oops, something went wrong.

0 comments on commit bf4a89d

Please sign in to comment.