https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# prisma-whats-new
  • m

    mike.johnson

    07/17/2017, 8:16 PM
    yeah, i am just trying to query my endpoint on a creation event before mutating the result and saving
    n
    • 2
    • 2
  • a

    auser

    07/17/2017, 8:17 PM
    yeah, I do that on transform mutation function
  • a

    auser

    07/17/2017, 8:17 PM
    @nilan works with gcool, so he’ll help
  • a

    auser

    07/17/2017, 8:17 PM
    better than I
  • m

    martin

    07/17/2017, 9:06 PM
    What would I have to do to chain multiple
    Promises
    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.
    Copy code
    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]`:
    Copy code
    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)
    })
    a
    • 2
    • 152
  • j

    joshjoe

    07/17/2017, 10:33 PM
    I’m creating a form to create a person in Graph.cool. I’m noticing there seem to be a lot of places where I’m repeating the same information. 1. My mutation has a list of the variable names and their types 2. my state has the form object to back the values in the fields and it is a strikingly similar object. 3. In my state I have another object called,
    hasError
    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?
  • s

    stton

    07/18/2017, 12:10 AM
    anyone figure out the "Websocket is closed before the connection is established" issue?
  • d

    dtuite

    07/18/2017, 12:39 AM
    Has anyone managed to integrate a react-native application with Auth0 for authentication? I’m stuck with the HS256 vs RS256 issue. I can get an HS256 token back from Auth0 if I neglect to provide the
    audience
    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?
    p
    n
    • 3
    • 10
  • m

    mwickett

    07/18/2017, 2:53 AM
    Just wanted to drop a shout out to @agartha who has been helping so many on here, including myself.
    ❤️ 8
  • c

    coffenbacher

    07/18/2017, 3:48 AM
    Hey guys, how do I filter to include null values of a nullable enum? Something like this, but I can't seem to get it working
    Copy code
    filter: {fooField_in: ["bar", null]}
    n
    • 2
    • 5
  • w

    wallslide

    07/18/2017, 8:10 AM
    graphcool console is acting strange. When I go to load it, it stays on a completely blank screen for me for several seconds, and then suddenly appears
    n
    • 2
    • 6
  • m

    marcusstenbeck

    07/18/2017, 10:31 AM
    I can’t choose a migration value in the Graphcool scehema editor when the type is an enum.
    n
    • 2
    • 4
  • a

    agartha

    07/18/2017, 11:43 AM
    Q: Any documentation available on
    graphcool-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?
    n
    c
    • 3
    • 21
  • y

    yucun

    07/18/2017, 2:52 PM
    Q: I am looking for documentation about accessing web service to fetch and change data, and use other database. I wonder if it is possible to support these functions. Right now, it seems i have to use graphcool's storage and functions...but i want to access my own webservice
    d
    c
    n
    • 4
    • 13
  • m

    mwickett

    07/18/2017, 3:11 PM
    @yucun Seems like you're better off to roll your own backend?
    y
    • 2
    • 1
  • c

    cj

    07/18/2017, 3:39 PM
    morning! quick question... how come graph.cool decided not to use the edges pattern for multiple records/pagination?
    n
    • 2
    • 14
  • s

    spences10

    07/18/2017, 3:42 PM
    Afternoon, if I have a large 'table' and want to delete all data from it, can I do it with a delete query?
  • s

    spences10

    07/18/2017, 3:44 PM
    Say if I have one field which is
    1
    say, is it possible to delete where field=
    1
    ??
    n
    • 2
    • 4
  • c

    ckelley

    07/18/2017, 4:01 PM
    Can
    graphcool-lib
    be used to make API calls in functions that are not schema extensions?
    n
    • 2
    • 2
  • m

    mike.johnson

    07/18/2017, 5:13 PM
    Testing out a SSS and it's not getting fired. Made a new function, didn't change anything, then created a mutation but the function still shows 0 invocations
    a
    n
    • 3
    • 34
  • p

    peterp

    07/18/2017, 6:32 PM
    whats the largest rawJsonList ya’ll support? I just got
    rawJsonList
    is too long
    n
    • 2
    • 3
  • p

    peterp

    07/18/2017, 10:06 PM
    Is ther ean opportunity to batch mutations using
    gql
    and react native for apollo?
  • p

    peterp

    07/18/2017, 10:06 PM
    something like this?
  • p

    peterp

    07/18/2017, 10:06 PM
    Copy code
    const batchedMutations = createBatchedGqlMutations(contacts)
         this.props.client.mutate(batchedMutations)
  • p

    peterp

    07/18/2017, 10:07 PM
    I’ve figured out how to do this in graphql-request lib, but not using react native for graphql
  • p

    peterp

    07/18/2017, 10:07 PM
    that function looks like this:
  • p

    peterp

    07/18/2017, 10:07 PM
    Copy code
    function createBatchedGqlMutations (contacts) {
         return contacts.map(c => {
           return {
             mutation: createUserAddressBookContact,
             variables: {
               userId: 'xxx',
               ...c
             }
           }
         })
       }
  • p

    peterp

    07/18/2017, 10:09 PM
    Ah, I see this on the docs: http://dev.apollodata.com/core/network.html#BatchingExample
  • p

    peterp

    07/18/2017, 10:09 PM
    but do i have to create a new interface for this query?
  • p

    peterp

    07/18/2017, 10:18 PM
    or do i create a batchinginterface alongside a normal network interface?
1...275276277...637Latest