6

I'm trying to set timeout with prisma-labs/graphql-request. I've tried the way described here - https://github.com/prisma-labs/graphql-request/issues/103.

const client = new GraphQLClient(config.url, {
  timeout: 30000,
  headers: {
    Authorization: `Bearer ${token}`
  }
})

My compiler complains as timeout is not directly present in Options interface - https://github.com/prisma-labs/graphql-request/blob/master/src/types.ts#L7.

Should I need to extend the Options interface to use timeout field?

unknown_boundaries
  • 1,482
  • 3
  • 25
  • 47

1 Answers1

0

if you calling this thru regular api for your service remember it might also timing out on your webserver like express or fastify, try to increase all timeouts there as well e.g

fastify: {
  trustProxy: true,
  connectionTimeout: 15000,
},
Johnny Cage
  • 5,526
  • 2
  • 11
  • 7