dotansimha / graphql-yoga

🧘 Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements WHATWG Fetch API and can run/deploy on any JS environment.
https://the-guild.dev/graphql/yoga-server
MIT License
8.25k stars 574 forks source link

Fastify Context & schema TS types. #3258

Open rainyEra opened 6 months ago

rainyEra commented 6 months ago

Describe the bug

Context is not being typed.

Your Example Website or App

https://codesandbox.io/p/devbox/beautiful-dust-h4f98s?file=%2Findex.ts%3A12%2C13

Steps to Reproduce the Bug or Issue

Reproduced

Expected behavior

The context should be typed

Screenshots or Videos

image image

Platform

Additional context

No.

ardatan commented 6 months ago

These two definitions have nothing to do with each other. That's why you cannot get "context" typed. createSchema also takes a context generic that might help for you.

image