<@U0RQY0KK5> Hello! I got an error: "Error: GraphQ...
# prisma-whats-new
c
@nilan Hello! I got an error: "Error: GraphQL error: Whoops. Looks like an internal server error. Please contact us in Slack (https://slack.graph.cool) and send us your Request ID: cj3a8af7vzvjd01480u5812f3" Can you provide me some help where to look at 🙂 My guess is that i have some problem with my inline request pipeline function.
n
@checkmatez hey, taking a look right now. What does the mutation look like?
c
original one? That invokes function? 🙂 I have one mutation inside function body too
n
ah interesting
c
Copy code
mutation makeMove($gameId: ID!, $square: Int!, $mark: MOVE_MARK!) {
    createMove(gameId: $gameId, square: $square, mark: $mark) {
      id
      square
      mark
    }
  }
Thats the original
n
does that mutation work when the function is disabled?
c
absolutely
also it works even with function turned on 🙂
but still have an error in browser console
n
how does the response look like when the function is activated?
c
You mean what function returns?
Copy code
{
  "data": {
    "updatedAt": "2017-05-29 14:34:09.0",
    "square": "1",
    "id": "cj3a8izq042810123m6hmjhvk",
    "createdAt": "2017-05-29 14:34:09.0",
    "mark": "X"
  }
}
Im not sure if im supposed to return only fields that was being requested...
n
yea
is it a
TRANSFORM_PAYLOAD
?
c
yes
c
But then how do i figure out what fields was requested in the payload?
n
only those that are included in
event.data
c
i dont actually modify event in any way 🙂 i return simply a promise with
Copy code
resolve({ data: event.data })
n
alright. complete other guess right now. do you return an integer for
square
? Did you recently switch the type for a field to/from
Float
?
c
In function logs looks like an integer to me... No i did not switch type
n
can you share the function itself?
Basically i make additional request to get all the moves made, then check if new move results in a won game for either player, and if so make mutation to set the game status accordingly.
Man, functions are hard to debug 🙂
I tested this function locally in node and it worked well. Probably the problem with returning result
n
(you should probably remove the auth token there)
👍 1