My first push of a resolver function, and the serv...
# prisma-whats-new
l
My first push of a resolver function, and the server returns a 500
1
Copy code
{
  "data": {
    "assignmentLTILaunch": null
  },
  "errors": [
    {
      "message": "Whoops. Looks like an internal server error. Please contact us from the Console (<https://console.graph.cool>) or via email (support@graph.cool) and include your Request ID: us-west-2:simple:cj8vq4nh200000174arcy8jgg",
      "requestId": "us-west-2:simple:cj8vq4nh200000174arcy8jgg",
      "path": [
        "assignmentLTILaunch"
      ],
      "locations": [
        {
          "line": 2,
          "column": 2
        }
      ]
    }
  ]
}
Here's the schema:
Copy code
type AssignmentLTILaunchPayload {
    ltiJWT: String
    ltiSessionIdJWT: String!
    clientRedirectUrl: String!
    serverRedirectUrl: String!
}

extend type Mutation {
    assignmentLTILaunch(assignmentId: String!, assignmentType: String!, requestBody: String!): AssignmentLTILaunchPayload
}
a
You get that error when running it?
l
Yes, every time
Mutliple redeploys, trying to make the function as simple as possible, always happens
a
There's an error in your function code
Is the most simple version shareable?
l
Copy code
export default async (event: any) => {

}
a
You're not returning anything
try
return { data: null }
l
Okay, the 500 went away
👍🏻 1
I was thrown off by not having a descriptive error message
Now my data is always nul
Copy code
export default async (event: any) => {
    return {
        ltiJWT: 'hello',
        ltiSessionIdJWT: 'hello',
        clientRedirectUrl: 'hello',
        serverRedirectUrl: 'hello'
    };
}
a
You forgot the
data
part
l
Oh, yes
Sorry
a
np
l
There we go, thank you
a
Cheers