Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for context option #10

Closed
pyrossh opened this issue Nov 24, 2017 · 12 comments
Closed

Update docs for context option #10

pyrossh opened this issue Nov 24, 2017 · 12 comments

Comments

@pyrossh
Copy link

pyrossh commented Nov 24, 2017

The readme shows that context is an object type but it also accepts a function. I found that out by reading the source code as I needed to intialize a new context object on every request. Its better if it would be a function always as the context is generally per graphql request.

@kbrandwijk
Copy link
Contributor

Updated in the latest release.

@karloluis
Copy link

Would you please provide a link to the section in question? I could use some clarification.

@schickling
Copy link
Contributor

I agree, @karloluis. The context docs should be revisited and have their own subsection in the readme docs.

@nikolasburk will look into this.

@schickling schickling reopened this Feb 13, 2018
@karloluis
Copy link

Trying to use context for development but I can't seem to find it at all. Any chance someone can point to where it currently is described? Maybe I'll get something done while the docs are reworked for this in particular. Thanks in advanced.

@pyrossh
Copy link
Author

pyrossh commented Feb 14, 2018

Its documented right here,
https://github.com/graphcool/graphql-yoga#constructorprops-props-graphqlserver
This is how I use context,

const context = async ({ request }) => {
  const ctx = {
    timestamp: moment(),
  }
  const qs = querystring.parse(request.url);
  if (process.env.NODE_ENV === 'development' && request.headers['x-timestamp']) {
    ctx.timestamp = moment(request.headers['x-timestamp']);
  }
  return ctx;
};

const server = new GraphQLServer({
    typeDefs,
    resolvers,,
    context,
});

@stale
Copy link

stale bot commented Nov 23, 2018

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

@stale stale bot added the stale label Nov 23, 2018
@stale
Copy link

stale bot commented Nov 30, 2018

Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of graphql-yoga we'll close it.
Feel free to reopen it at any time if you believe we should futher discuss its content. 🙂

@stale stale bot closed this as completed Nov 30, 2018
@nikolasburk nikolasburk reopened this Nov 30, 2018
@stale stale bot removed the stale label Nov 30, 2018
@stale
Copy link

stale bot commented Jan 29, 2019

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

@stale stale bot added the status/stale label Jan 29, 2019
@stale
Copy link

stale bot commented Feb 5, 2019

Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of graphql-yoga we'll close it.
Feel free to reopen it at any time if you believe we should futher discuss its content. 🙂

@stale stale bot closed this as completed Feb 5, 2019
@nikolasburk nikolasburk reopened this Feb 5, 2019
@stale stale bot removed the status/stale label Feb 5, 2019
@stale
Copy link

stale bot commented May 24, 2019

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

@stale stale bot added the status/stale label May 24, 2019
@stale
Copy link

stale bot commented May 31, 2019

Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of graphql-yoga we'll close it.
Feel free to reopen it at any time if you believe we should futher discuss its content. 🙂

@stale stale bot closed this as completed May 31, 2019
@Urigo
Copy link
Collaborator

Urigo commented Mar 29, 2022

Hey, @Urigo from The Guild here!

You might know us from projects such as graphql-code-generator, envelop or graphql-tools.

For a long time we thought that the Javascript ecosystem is still missing a lightweight cross-platform, but still highly customizable GraphQL Server.

In the past the awesome Prisma team took on that great challenge and now we are happy to announce that we are continuing them and just released GraphQL Yoga 2.0 - Build fast, extensible, and batteries-included (Subscriptions, Serverless, File uploads support) GraphQL APIs in Node.js 🚀

We have been working a long time on version 2.0 and have been using it in our clients projects for a few months now and shared a couple of alpha cycles here.
Thank you all for your feedback and suggestions, you made this release possible!

Please try Yoga out again, give us feedback and help us spread the word on the new release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants