Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/apollo-server/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable no-console */
import { ApolloServer } from 'apollo-server';
import { envelop, useSchema, useTiming } from '@envelop/core';
import { envelop, useSchema } from '@envelop/core';
import { parse, validate, subscribe, execute } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { ApolloServerPluginLandingPageGraphQLPlayground } from 'apollo-server-core';

Expand All @@ -18,7 +19,11 @@ const schema = makeExecutableSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useTiming()],
parse,
validate,
subscribe,
execute,
plugins: [useSchema(schema)],
});

const server = new ApolloServer({
Expand Down
3 changes: 2 additions & 1 deletion examples/apollo-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"@envelop/core": "*",
"apollo-server": "3.5.0",
"apollo-server-core": "3.5.0",
"@graphql-tools/schema": "8.5.0"
"@graphql-tools/schema": "8.5.0",
"graphql": "16.6.0"
},
"devDependencies": {
"@types/node": "15.6.1",
Expand Down
9 changes: 7 additions & 2 deletions examples/azure-functions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { envelop, useLogger, useSchema, useTiming } from '@envelop/core';
import { envelop, useLogger, useSchema } from '@envelop/core';
import { parse, validate, subscribe, execute } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { AzureFunction, Context, HttpRequest } from '@azure/functions';
import { getGraphQLParameters, processRequest, Response } from 'graphql-helix';
Expand All @@ -17,7 +18,11 @@ const schema = makeExecutableSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});

export const index: AzureFunction = async (context: Context, req: HttpRequest): Promise<void> => {
Expand Down
3 changes: 2 additions & 1 deletion examples/azure-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"dependencies": {
"graphql-helix": "1.8.3",
"@envelop/core": "*",
"@graphql-tools/schema": "8.5.0"
"@graphql-tools/schema": "8.5.0",
"graphql": "16.6.0"
},
"devDependencies": {
"@azure/functions": "1.2.3",
Expand Down
9 changes: 7 additions & 2 deletions examples/cloudflare-workers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { envelop, useLogger, useSchema, useTiming } from '@envelop/core';
import { envelop, useLogger, useSchema } from '@envelop/core';
import { parse, validate, execute, subscribe } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { getGraphQLParameters, processRequest, Response } from 'graphql-helix';
import { Router } from 'worktop';
Expand All @@ -20,7 +21,11 @@ const schema = makeExecutableSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});

router.add('POST', '/graphql', async (req, res) => {
Expand Down
3 changes: 2 additions & 1 deletion examples/cloudflare-workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"graphql-helix": "1.8.3",
"@envelop/core": "*",
"@graphql-tools/schema": "8.5.0",
"worktop": "0.7.0"
"worktop": "0.7.0",
"graphql": "16.6.0"
},
"devDependencies": {
"@cloudflare/workers-types": "2.2.2",
Expand Down
9 changes: 7 additions & 2 deletions examples/express-graphql/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { envelop, useLogger, useSchema, useTiming } from '@envelop/core';
import { envelop, useLogger, useSchema } from '@envelop/core';
import { parse, validate, execute, subscribe } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';
import express from 'express';
import { graphqlHTTP } from 'express-graphql';
Expand All @@ -17,7 +18,11 @@ const schema = makeExecutableSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});

const app = express();
Expand Down
3 changes: 2 additions & 1 deletion examples/express-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"express": "3.14.0",
"express-graphql": "0.12.0",
"@envelop/core": "*",
"@graphql-tools/schema": "8.5.0"
"@graphql-tools/schema": "8.5.0",
"graphql": "16.6.0"
},
"devDependencies": {
"@types/node": "15.6.1",
Expand Down
9 changes: 7 additions & 2 deletions examples/google-cloud-functions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { envelop, useLogger, useSchema, useTiming } from '@envelop/core';
import { envelop, useLogger, useSchema } from '@envelop/core';
import { parse, validate, execute, subscribe } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';
import * as functions from 'firebase-functions';
import { getGraphQLParameters, processRequest, Response } from 'graphql-helix';
Expand All @@ -17,7 +18,11 @@ const schema = makeExecutableSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});

// https://firebase.google.com/docs/functions/typescript
Expand Down
3 changes: 2 additions & 1 deletion examples/google-cloud-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"@envelop/core": "*",
"firebase-admin": "9.9.0",
"firebase-functions": "3.14.1",
"@graphql-tools/schema": "8.5.0"
"@graphql-tools/schema": "8.5.0",
"graphql": "16.6.0"
},
"main": "lib/index.js",
"devDependencies": {
Expand Down
5 changes: 5 additions & 0 deletions examples/graphql-helix-auth0/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import fastify from 'fastify';
import { getGraphQLParameters, processRequest, renderGraphiQL, sendResult, shouldRenderGraphiQL } from 'graphql-helix';
import { envelop, useSchema } from '@envelop/core';
import { parse, validate, execute, subscribe } from 'graphql';
import { useAuth0 } from '@envelop/auth0';
import { makeExecutableSchema } from '@graphql-tools/schema';

Expand Down Expand Up @@ -40,6 +41,10 @@ const auth0Config = {
};

const getEnveloped = envelop({
parse,
validate,
execute,
subscribe,
plugins: [
useSchema(schema),
useAuth0({
Expand Down
3 changes: 2 additions & 1 deletion examples/graphql-helix-auth0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"@envelop/core": "*",
"@envelop/auth0": "*",
"graphql-helix": "1.8.3",
"@graphql-tools/schema": "8.5.0"
"@graphql-tools/schema": "8.5.0",
"graphql": "16.6.0"
},
"devDependencies": {
"@types/node": "15.6.1",
Expand Down
9 changes: 7 additions & 2 deletions examples/graphql-helix-defer-stream/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable no-console */
import fastify from 'fastify';
import { getGraphQLParameters, processRequest, renderGraphiQL, sendResult, shouldRenderGraphiQL } from 'graphql-helix';
import { envelop, useLogger, useSchema, useTiming } from '@envelop/core';
import { parse, validate, execute, subscribe } from 'graphql';
import { envelop, useLogger, useSchema } from '@envelop/core';
import { makeExecutableSchema } from '@graphql-tools/schema';

const sleep = (t = 1000) => new Promise(resolve => setTimeout(resolve, t));
Expand Down Expand Up @@ -140,7 +141,11 @@ const graphiQLContent = /* GraphQL */ `
`;

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});
const app = fastify();

Expand Down
9 changes: 7 additions & 2 deletions examples/graphql-helix/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable no-console */
import fastify from 'fastify';
import { getGraphQLParameters, processRequest, renderGraphiQL, sendResult, shouldRenderGraphiQL } from 'graphql-helix';
import { envelop, useLogger, useSchema, useTiming } from '@envelop/core';
import { envelop, useLogger, useSchema } from '@envelop/core';
import { parse, validate, execute, subscribe } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';

const schema = makeExecutableSchema({
Expand All @@ -18,7 +19,11 @@ const schema = makeExecutableSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});
const app = fastify();

Expand Down
3 changes: 2 additions & 1 deletion examples/graphql-helix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"fastify": "3.14.0",
"@envelop/core": "*",
"graphql-helix": "1.8.3",
"@graphql-tools/schema": "8.5.0"
"@graphql-tools/schema": "8.5.0",
"graphql": "16.6.0"
},
"devDependencies": {
"@types/node": "15.6.1",
Expand Down
7 changes: 3 additions & 4 deletions examples/graphql-socket.io/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Server } from 'socket.io';
import * as http from 'http';
import { registerSocketIOGraphQLServer } from '@n1ru4l/socket-io-graphql-server';
import { envelop, useLogger, useSchema, useTiming } from '@envelop/core';
import { envelop, useLogger, useSchema } from '@envelop/core';
import { parse, validate, execute, subscribe } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';

const schema = makeExecutableSchema({
Expand All @@ -17,9 +18,7 @@ const schema = makeExecutableSchema({
},
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
});
const getEnveloped = envelop({ parse, validate, execute, subscribe, plugins: [useSchema(schema), useLogger()] });

const httpServer = http.createServer();
const socketServer = new Server(httpServer);
Expand Down
3 changes: 2 additions & 1 deletion examples/graphql-socket.io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"graphql-ws": "^4.4.2",
"ws": "7.4.5",
"socket.io": "4.1.2",
"socket.io-client": "4.1.2"
"socket.io-client": "4.1.2",
"graphql": "16.6.0"
},
"devDependencies": {
"@types/node": "15.6.1",
Expand Down
9 changes: 7 additions & 2 deletions examples/graphql-sse/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import http from 'http';
import { envelop, useSchema, useLogger, useTiming } from '@envelop/core';
import { envelop, useSchema, useLogger } from '@envelop/core';
import { parse, validate, execute, subscribe } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { createHandler } from 'graphql-sse';

Expand Down Expand Up @@ -30,7 +31,11 @@ const schema = makeExecutableSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});

const handler = createHandler({
Expand Down
3 changes: 2 additions & 1 deletion examples/graphql-sse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"dependencies": {
"@envelop/core": "*",
"@graphql-tools/schema": "8.5.0",
"graphql-sse": "^1.0.1"
"graphql-sse": "^1.0.1",
"graphql": "16.6.0"
},
"devDependencies": {
"@types/node": "15.6.1",
Expand Down
9 changes: 7 additions & 2 deletions examples/graphql-ws/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { envelop, useSchema, useLogger, useTiming } from '@envelop/core';
import { envelop, useSchema, useLogger } from '@envelop/core';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { parse, validate, execute, subscribe } from 'graphql';
import ws from 'ws';
import { useServer } from 'graphql-ws/lib/use/ws';

Expand Down Expand Up @@ -30,7 +31,11 @@ const schema = makeExecutableSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});

useServer(
Expand Down
3 changes: 2 additions & 1 deletion examples/graphql-ws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"@envelop/core": "*",
"@graphql-tools/schema": "8.5.0",
"graphql-ws": "^4.4.2",
"ws": "7.4.5"
"ws": "7.4.5",
"graphql": "16.6.0"
},
"devDependencies": {
"@types/node": "15.6.1",
Expand Down
9 changes: 7 additions & 2 deletions examples/lambda-aws/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { envelop, useLogger, useSchema, useTiming } from '@envelop/core';
import { envelop, useLogger, useSchema } from '@envelop/core';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { parse, validate, execute, subscribe } from 'graphql';
import { APIGatewayProxyHandler } from 'aws-lambda';
import { getGraphQLParameters, processRequest, Response } from 'graphql-helix';

Expand All @@ -17,7 +18,11 @@ const schema = makeExecutableSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});

export const lambdaHandler: APIGatewayProxyHandler = async event => {
Expand Down
3 changes: 2 additions & 1 deletion examples/lambda-aws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"graphql-helix": "1.8.3",
"@envelop/core": "*",
"@graphql-tools/schema": "8.5.0",
"aws-sdk": "2.918.0"
"aws-sdk": "2.918.0",
"graphql": "16.6.0"
},
"devDependencies": {
"@types/aws-lambda": "8.10.76",
Expand Down
9 changes: 7 additions & 2 deletions examples/nexus/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable no-console */
import 'reflect-metadata';
import fastify from 'fastify';
import { envelop, useLogger, useSchema, useTiming } from '@envelop/core';
import { envelop, useLogger, useSchema } from '@envelop/core';
import { parse, validate, execute, subscribe } from 'graphql';
import { getGraphQLParameters, processRequest, renderGraphiQL, sendResult, shouldRenderGraphiQL } from 'graphql-helix';
import { arg, enumType, intArg, interfaceType, makeSchema, objectType, queryType, stringArg, list } from 'nexus';

Expand Down Expand Up @@ -51,7 +52,11 @@ const schema = makeSchema({
});

const getEnveloped = envelop({
plugins: [useSchema(schema), useLogger(), useTiming()],
parse,
validate,
execute,
subscribe,
plugins: [useSchema(schema), useLogger()],
});

const app = fastify();
Expand Down
Loading