mike.johnson
07/17/2017, 8:16 PMauser
07/17/2017, 8:17 PMauser
07/17/2017, 8:17 PMauser
07/17/2017, 8:17 PMmartin
07/17/2017, 9:06 PMPromises
inside server-side subscription functions?
Once I receive from SendGrid (the email service provider) the email ID response.body.persisted_recipients[0]
, I would need to assign it to a list inside SendGrid—basically repeat the whole thing.
module.exports = function (event) {
var sg = require("sendgrid")(___SENDGRID_API_KEY___)
var request = sg.emptyRequest()
request.body = [{
"email": event.data.User.node.email,
"first_name": event.data.User.node.nameFirst,
"last_name": event.data.User.node.nameLast
}];
request.method = "POST"
request.path = "/v3/contactdb/recipients"
return new Promise(function(resolve, reject) {
sg.API(request, function (error, response) {
if (error) {
console.log("Error response received")
reject(error)
}
console.log(response.statusCode)
console.log(response.body)
console.log(response.headers)
console.log("SendGrid email ID")
console.log(response.body.persisted_recipients[0])
resolve(response)
})
})
}
Now this needs to be executed using the response, `response.body.persisted_recipients[0]`:
var request = sg.emptyRequest()
request.method = 'POST'
request.path = '/v3/contactdb/lists/___LIST_ID___/recipients/' + response.body.persisted_recipients[0]
sg.API(request, function (error, response) {
console.log(response.statusCode)
console.log(response.body)
console.log(response.headers)
})
joshjoe
07/17/2017, 10:33 PMhasError
which has the same object structure as the state backed field object, but is all booleans to identify form fields that have errors. 4. The onSubmit method calls this.props.mutate
and it takes a variables object, which gets that state for each of the fields I need to pass to the mutate method 5. Then I have the actual HTML form. This seems excessive, anyone have any advice here?stton
07/18/2017, 12:10 AMdtuite
07/18/2017, 12:39 AMaudience
attribute. However, that’s rejected by GraphQL because it doesn’t have an audience
. If I set the audience I get RS256 from Auth0 even though I have explicitly set my client to use HS256.
I can’t seem to use the “Regular Web Application” setting because this is a mobile native application.
Any ideas?mwickett
07/18/2017, 2:53 AMcoffenbacher
07/18/2017, 3:48 AMfilter: {fooField_in: ["bar", null]}
wallslide
07/18/2017, 8:10 AMmarcusstenbeck
07/18/2017, 10:31 AMagartha
07/18/2017, 11:43 AMgraphcool-lib
that's popping up in a few examples. Can it only be used with custom queries/mutations, or also in regular inline/webhook functions?yucun
07/18/2017, 2:52 PMmwickett
07/18/2017, 3:11 PMcj
07/18/2017, 3:39 PMspences10
07/18/2017, 3:42 PMspences10
07/18/2017, 3:44 PM1
say, is it possible to delete where field=1
??ckelley
07/18/2017, 4:01 PMgraphcool-lib
be used to make API calls in functions that are not schema extensions?mike.johnson
07/18/2017, 5:13 PMpeterp
07/18/2017, 6:32 PMrawJsonList
is too longpeterp
07/18/2017, 10:06 PMgql
and react native for apollo?peterp
07/18/2017, 10:06 PMpeterp
07/18/2017, 10:06 PMconst batchedMutations = createBatchedGqlMutations(contacts)
this.props.client.mutate(batchedMutations)
peterp
07/18/2017, 10:07 PMpeterp
07/18/2017, 10:07 PMpeterp
07/18/2017, 10:07 PMfunction createBatchedGqlMutations (contacts) {
return contacts.map(c => {
return {
mutation: createUserAddressBookContact,
variables: {
userId: 'xxx',
...c
}
}
})
}
peterp
07/18/2017, 10:09 PMpeterp
07/18/2017, 10:09 PMpeterp
07/18/2017, 10:18 PM