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

    nilan

    01/23/2017, 9:54 PM
    try
    $myEmail: String
    for example, and
    $myEmail
    respectively
  • c

    charlieroth

    01/23/2017, 9:54 PM
    will do
  • n

    nilan

    01/23/2017, 9:56 PM
    oh wait
  • c

    charlieroth

    01/23/2017, 9:56 PM
    I still get the same error
  • n

    nilan

    01/23/2017, 9:56 PM
    sorry that's just wrong
  • n

    nilan

    01/23/2017, 9:56 PM
    Copy code
    const LoginUserMutation = gql
      mutation signinUser($email: String!, $password: String!){
        signinUser(email: {email: $email, password: $password }) {
          token
        }
    }
  • n

    nilan

    01/23/2017, 9:56 PM
    this should work 🙂
  • n

    nilan

    01/23/2017, 9:56 PM
    I'll create an issue for the docs right away
  • c

    charlieroth

    01/23/2017, 9:57 PM
    Works! Thanks @nilan
  • n

    nilan

    01/23/2017, 9:57 PM
    awesome! 💪
  • c

    codepreneur

    01/24/2017, 8:02 AM
    I need some help from people who really understand graphql/relay: http://stackoverflow.com/questions/41818143/how-to-pass-video-node-from-resolve-database-to-node-definitions-in-graphql-rela
  • p

    peeter

    01/24/2017, 8:47 AM
    @codepreneur
  • p

    peeter

    01/24/2017, 8:47 AM
    What are you trying to do? You're returning an empty video / store from your nodeDefinitions function ?
  • p

    peeter

    01/24/2017, 8:49 AM
    (globalId) => { let type = fromGlobalId(globalId).type let id = fromGlobalId(globalId).id if (type === 'Store') { return store } if (type === 'Video') { return video } return null }
  • p

    peeter

    01/24/2017, 8:49 AM
    That function needs to return an actual video and store from the database.
  • p

    peeter

    01/24/2017, 8:50 AM
    You're just returning an empty instance of a store / video object.
  • p

    peeter

    01/24/2017, 8:50 AM
    Are you sure you're returning a promise from that function, if you're doing data loading?
  • c

    codepreneur

    01/24/2017, 9:53 AM
    in the resolve? yes
  • c

    codepreneur

    01/24/2017, 9:53 AM
    I updated the question
  • c

    codepreneur

    01/24/2017, 9:53 AM
    even if I remove video part
  • c

    codepreneur

    01/24/2017, 9:53 AM
    it still gives me null
  • c

    codepreneur

    01/24/2017, 9:53 AM
    @peeter
  • c

    codepreneur

    01/24/2017, 9:54 AM
    how would I return store/video from the database there ?
  • c

    codepreneur

    01/24/2017, 9:54 AM
    I tried and it didnt work, seems like graphql is ignoring my node definitions
  • c

    codepreneur

    01/24/2017, 9:54 AM
    if I put console logs they dont run
  • c

    codepreneur

    01/24/2017, 9:54 AM
    and besides, how come getting many videos work ?
  • p

    peeter

    01/24/2017, 11:30 AM
    Because when you query a connection ("many videos"), they go through this part: resolve: (_, args) => { return docClient.query( Object.assign( {}, {TableName: pokemonTable}, {KeyConditionExpression: 'id = :id'}, {ExpressionAttributeValues: { ':id': args.id }}, paginationToParams(args) ) ).promise().then(dataToConnection) }
  • p

    peeter

    01/24/2017, 11:31 AM
    But if you're querying through the node interface [node (id: x)], then it's using nodeDefinitions to find that model
  • p

    peeter

    01/24/2017, 11:31 AM
    if (type === 'Video') { return docClient.query( Object.assign( {}, {TableName: pokemonTable}, {KeyConditionExpression: 'id = :id'}, {ExpressionAttributeValues: { ':id': args.id }}, paginationToParams(args) ) ).promise(); }
  • p

    peeter

    01/24/2017, 11:31 AM
    Something in the lines of that
1...858687...637Latest