sorenbs
lkbr
08/31/2017, 8:42 AMgeg
08/31/2017, 9:35 AMotissv
08/31/2017, 9:46 AMconst config = {
mutation,
variables,
optimisticUpdater: proxyStore => {
// 1 - create the `newNote` as a mock that can be added to the store
const id = 'client:newNote:' + tempID++;
const newNote = proxyStore.create(id, 'Note');
console.log(newNote);
console.log(variables);
newNote.setValue(id, 'id');
console.log(variables);
Object.keys(variables.input).forEach(key =>
newNote.setValue(variables.input[key], `${key}`)
);
// // 2 - add `newNote` to the store
const viewerProxy = proxyStore.get(viewerId);
console.log(viewerProxy);
const connection = ConnectionHandler.getConnection(
viewerProxy,
'ListPage_allNotes'
);
if (connection) {
ConnectionHandler.insertEdgeAfter(connection, newNote);
}
},
updater: proxyStore => {
// 1 - retrieve the `newNote` from the server response
const createNoteField = proxyStore.getRootField('createNote');
const newNote = createNoteField.getLinkedRecord('Note');
// 2 - add `newNote` to the store
const viewerProxy = proxyStore.get(viewerId);
const connection = ConnectionHandler.getConnection(
viewerProxy,
'ListPage_allNotes'
);
if (connection) {
ConnectionHandler.insertEdgeAfter(connection, newNote);
}
},
onError: error => console.log(error)
};
commitMutation(environment, config);
}
Thank you.eerrecalde
08/31/2017, 11:15 AMchristbkk
08/31/2017, 11:35 AMchristbkk
08/31/2017, 11:36 AMPieter
08/31/2017, 2:13 PMPieter
08/31/2017, 2:14 PMmutate({variables: {foo: 'bar' })
it says it got a string instead of the enum, but how do you use the enum then if it isn't expecting a string?senorcodecat
08/31/2017, 2:36 PMmarsupio
08/31/2017, 4:12 PMmarsupio
08/31/2017, 4:13 PMdoug_w
08/31/2017, 4:17 PMgmuresan
08/31/2017, 4:24 PMmarsupio
08/31/2017, 5:38 PMnilan
08/31/2017, 5:54 PMnilan
08/31/2017, 5:55 PMmattd
08/31/2017, 5:55 PMdoug_w
08/31/2017, 6:14 PMgraphcool push
. Or is it best practice to handle all schema updates locally then push it up to the remote?mwickett
08/31/2017, 6:14 PMgraphcool pull
should do it.doug_w
08/31/2017, 6:14 PMmwickett
08/31/2017, 6:14 PMdixonbydesign
08/31/2017, 6:32 PMuser
query to get data for the currently logged in user. When my app renders on the server the user and data are present but when it renders on the client the user is null
. It seems other queries are working as expected. Any ideas what my issue could be? Thanks!picosam
08/31/2017, 7:03 PMjson
field within a Schema Extension Function?doug_w
08/31/2017, 8:14 PM.graphcool
schema file would be awesome!cbranch
08/31/2017, 9:11 PMgraphql-request
?cbranch
08/31/2017, 9:12 PMlokka
, after realizing how dead that was and fragments are pretty much all I'm missingpicosam
08/31/2017, 9:24 PMError
CODE
500
MESSAGE
Cannot read property 'projectId' of undefined
ERROR
Script generated an unhandled synchronous exception.
I’m getting this when trying to test run my schema extension. I believe I may have not correctly populated headers
in the EXAMPLE EVENT?picosam
08/31/2017, 9:26 PMmlyons
08/31/2017, 9:45 PM