apollographql / apollo-tracing

A GraphQL extension for performance tracing
478 stars 35 forks source link

Next.js Support #28

Closed b-gibbs closed 3 years ago

b-gibbs commented 4 years ago

In moving from Express to the Next.js API server, I'm losing support for Apollo Studio. Perhaps apollo-server-micro doesn't support tracing? Are there any plans to add support for the engine to report the schema via apollo-server-micro served through the Next.js API routes?

sakhmedbayev commented 3 years ago

I think the issue is with CORS. Next.js' API routes by default set to 'same-origins'. I cannot find a way to make it work with apollo-server-micro.

abernix commented 3 years ago

This would be an issue and a question for the apollo-server-micro, not this repository, which is merely a (technical) specification for the tracing format structure. (Ultimately, this should just be a matter of setting the right headers.)

There's a minimal example of how to deal with CORS on the README of the apollo-server-micro package's npm page. (which is published from the README in the monorepo here)