Our great sponsors
-
envelop
Envelop is a lightweight library allowing developers to easily develop, share, collaborate and extend their GraphQL execution layer. Envelop is the missing GraphQL plugin system.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
loopback-next
LoopBack makes it easy to build modern API applications that require complex integrations.
-
apollo-server
🌍 Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.
Make “hard” GraphQL capabilities easy by installing powerful plugins (Caching, Tracing with Prometheus/DataDog/NewRelic/Sentry/OpenTelemetry/ApolloTracing, Loggers, GraphQL-Jit, Persisted Operations, Security with rate-limit/depth-limit/Auth0 and many others from the Plugins Hub)
We are also helping with that, so if you are migrating to Envelop and not sure what it includes/means for your project - feel free to reach out to us (through GitHub, email or the chat box in our website) and we would love to help you with that.
import { envelop, useSchema, useLogger } from '@envelop/core'; import fastify from 'fastify'; import { processRequest, getGraphQLParameters } from 'graphql-helix'; // This creates the `getEnveloped` function for us. Behind the scense the wrapped functions are created once, here. const getEnveloped = envelop({ plugins: [useSchema(schema), useLogger()], }); const app = fastify(); app.route({ method: ['POST'], url: '/graphql', async handler(req, res) { // Here we can pass the request and make available as part of the "context". // The return value is the a GraphQL-proxy that exposes all the functions. const { parse, validate, contextFactory, execute, schema } = getEnveloped({ req, }); const request = { body: req.body, headers: req.headers, method: req.method, query: req.query, }; const { operationName, query, variables } = getGraphQLParameters(request); // Here, we pass our custom functions to Helix, and it will take care of the rest. const result = await processRequest({ operationName, query, variables, request, schema, parse, validate, execute, contextFactory, }); if (result.type === 'RESPONSE') { res.status(result.status); res.send(result.payload); } else { // You can find a complete example with Subscriptions and stream/defer here: // https://github.com/contrawork/graphql-helix/blob/master/examples/fastify/server.ts res.send({ errors: [{ message: 'Not Supported in this demo' }] }); } }, }); app.listen(3000, () => { console.log(`GraphQL server is running...`); });
Redwood is a great example. We start with a small suggestion PR, and the Redwood team was open for new ideas - so now you can use envelop if you are a Redwood user !
By using useParserCache we make sure to parse every unique operation only once. By using useValidationCache we make sure to validate every unique operation only once. By using useGraphQLJit we replace the default execute function with a just-in-time implementation.
perEventContextResolver: suggested in this PR, and almost available in envelop.
@oneOf: suggested in this PR, and now available in envelop.
Public schema filter - for creating a simple GraphQL schema that can be used for public APIs based on existing GraphQL schema.
During that process, we also start to work with other frameworks and support them with that: Loopback, NestJS, Parse, Apollo Server and others.
During that process, we also start to work with other frameworks and support them with that: Loopback, NestJS, Parse, Apollo Server and others.
During that process, we also start to work with other frameworks and support them with that: Loopback, NestJS, Parse, Apollo Server and others.
During that process, we also start to work with other frameworks and support them with that: Loopback, NestJS, Parse, Apollo Server and others.