Skip to content

Commit beba812

Browse files
committed
fixes for website
added real plugins data
1 parent 0d84767 commit beba812

File tree

10 files changed

+306
-346
lines changed

10 files changed

+306
-346
lines changed

README.md

Lines changed: 23 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
## Envelop
22

3-
Envelop is a lightweight JavaScript library for wrapping GraphQL execution layer and flow, allowing developers to develop, share and collaborate on GraphQL-related plugins, while filling the missing pieces in GraphQL implementations.
3+
`envelop` is a lightweight JavaScript (/TypeScript) library for wrapping GraphQL execution layer and flow, allowing developers to develop, share
4+
and collaborate on GraphQL-related plugins while filling the missing pieces in GraphQL implementations.
45

5-
<p align="left">
6+
`envelop` aims to extend the GraphQL execution flow by adding plugins that enrichs the feature set of your application.
7+
8+
<p align="center">
69
<img height="150" src="./logo.png">
710
</p>
811

9-
`@envelop/core`: [![npm version](https://badge.fury.io/js/%40envelop%2Fcore.svg)](https://badge.fury.io/js/%40envelop%2Fcore)
12+
`@envelop/core`: [![npm version](https://badge.fury.io/js/%40envelop%2Fcore.svg)](https://www.npmjs.com/package/@envelop/core)
1013

1114
> Envelop is created and maintained by [The Guild](https://the-guild.dev/), and used in production by our clients.
1215
13-
### In depth
14-
15-
Our goal is to allow developers to keep the original GraphQL interfaces, while adding plugins to enrich the feature set of your application quickly, while sharing ideas, code and plugins with other developers.
16+
### [Envelop Key Concepts]((https://www.envelop.dev/docs#key-concepts))
1617

17-
Envelop is agnostic to the HTTP server you use, so it's not a traditional server. We do not aim to provide a complete server, you can use Envelop with any environment (NodeJS or browser) and any type of GraphQL workflow (client / server, client-side execute, or server to server). So any piece of code that uses GraphQL's `execute` can benefit from that layer.
18+
* Lightweight
19+
* Wraps the entire GraphQL pipeline, based on plugins
20+
* Low-level API for extending the execution layer
21+
* Agnostic to the HTTP layer
22+
* Agnostic to the schema tools
23+
* Plugins-based usage
24+
* No vendor-locking
1825

19-
The core of Envelop is zero-dependency, and will only apply changes to your GraphQL execution based on the plugins you wish to use. It can be integrated with any GraphQL server that follows [the execution phase, as defined in the GraphQL spec](https://spec.graphql.org/June2018/#sec-Executing-Requests) and let you provide your own lifecycle methods.
26+
[You can read more about the key concepts or Envelop here](https://www.envelop.dev/docs#key-concepts)
2027

21-
Separating the execution workflow and the logic that it runs in each phase allow you to write reusable piece of code, like logging, metric collection, error handling, custom validations, resolvers tracing (and integration with any external), authentication, authorization and much more, without the needs to write it explicitly every time, or in any project or microservice. With Envelop, you can easily create a wrapper around your common logics, and share it with others.
22-
23-
## Getting Started
28+
## [Getting Started](https://www.envelop.dev/docs/getting-started)
2429

2530
Start by adding the core of Envelop to your codebase:
2631

@@ -86,27 +91,16 @@ const getEnveloped = envelop({
8691
});
8792
```
8893

89-
> Envelop `plugins` are based on a simple event-based contact, that allow you easily to add more logic to your app. You can easily share and collaborate on plugins that you find generic.
90-
91-
## Integrations / Examples
94+
> [You can read more about here](https://www.envelop.dev/docs/getting-started)
9295
93-
Envelop provides a low-level API at consumption of the output, but a rich API while using it with plugins. Based on that, it's possible to integrate Envelop with many tools.
96+
## [Integrations / Examples](https://www.envelop.dev/docs/integrations)
9497

95-
We recommend using [`graphql-helix`](https://github.com/contrawork/graphql-helix) as the request pipeline orchestrator, as it allows the maximum flexibility and you can easily override/manage every part of the pipeline with Envelop.
96-
97-
Here's a list of integrations and examples:
98-
99-
| Server/Framework | Fully supported? | Example |
100-
| ---------------- | ---------------- | ------------------------------------------- |
101-
| Node's `http` | V | [`basic-http`](./examples/simple-http) |
102-
| GraphQL-Helix | V | [`graphql-helix`](./examples/graphql-helix) |
103-
| Apollo-Server | Almost | [`apollo-server`](./examples/apollo-server) |
104-
| GraphQL-WS | V | [`graphql-ws`](./examples/graphql-ws) |
105-
106-
> Since Envelop is not a HTTP server, and just a wrapper around GraphQL request pipeline - it's possible to integrate it with any server/framework, if it's flexible enough and allows you to specify the pipeline methods\*.
98+
[You can find the integrations and compatibility list, and code-based examples here](https://www.envelop.dev/docs/integrations)
10799

108100
## Available Plugins
109101

102+
You can explore all plugins in our [Plugins Hub](https://www.envelop.dev/plugins). If you wish your plugin to be listed here and under PluginsHub, feel free to add your plugin information [in this file](https://github.com/dotansimha/envelop/edit/main/website/src/lib/plugins.ts#L23) and create a Pull Request!
103+
110104
We provide a few built-in plugins within the `@envelop/core`, and many more plugins as standalone packages.
111105

112106
| Name | Package | Description |
@@ -141,23 +135,7 @@ We provide a few built-in plugins within the `@envelop/core`, and many more plug
141135

142136
After an `envelop` has been created, you can share it with others as a complete layer of plugins. This is useful if you wish to create a predefined layer of plugins, and share it with others. You can use it as a shell and as a base for writing sharable pieces of servers.
143137

144-
Here's a small exmple for sharing envelops:
145-
146-
```ts
147-
// Somewhere where you wish to create the basics of what you wish to share
148-
// This defined the base plugins you wish to use as base.
149-
const myBaseEnvelop = envelop({
150-
plugins: [useOrgAuth(), useOrgTracing(), useOrgLogsCollector()],
151-
});
152-
153-
// Later, when you create your own Envelop, you can extend that and add custom plugins.
154-
// You can also specify the schema only at this point
155-
const myEnvelop = envelop({
156-
plugins: [useEnvelop(myBaseEnvelop), useSchema(myServerSchema), useMyCustomPlugin()],
157-
});
158-
```
159-
160-
This approach allows developers to create a base Envelop and share it across the organization: you can define your monitoring setup, logging, authentication, etc, only once in a common package, and share it with others without losing the ability to extend it.
138+
You can read more about [Sharing and Composing Envelops here](https://www.envelop.dev/docs/composing-envelop).
161139

162140
## Write your own plugin!
163141

@@ -186,56 +164,7 @@ const getEnveloped = envelop({
186164
});
187165
```
188166

189-
> Feel free to share you plugin with us, or with the community. Sharing = Caring!
190-
191-
#### The plugin interface
192-
193-
You can find it here: https://github.com/dotansimha/envelop/blob/main/packages/types/src/index.ts#L50
194-
195-
#### Execution Lifecycle
196-
197-
By extending the GraphQL execution pipeline, we allow developers to write reusable plugins, that can be shared with others easily, as NPM packages. So instead of delivering a bloated GraphQL server with tons of features, we allow you to choose the HTTP server you prefer, the request pipeline you prefer, and the features you prefer.
198-
199-
We wrap the execution pipeline of GraphQL operation, and allow Envelop plugins to do the following:
200-
201-
- `parse`
202-
- Hook into the before/after of this phase
203-
- Override the parse function
204-
- Access to the parsed result
205-
- Modify the parsed result
206-
- `validate`
207-
- Hook into the before/after of this phase
208-
- Override the validation function
209-
- Access to the validation error results
210-
- Modify the validation results
211-
- Add custom validation rules
212-
- `contextFactory`
213-
- Hook into the before/after of this phase
214-
- Access to the initial HTTP request context
215-
- Extend the context with custom data
216-
- Replace the context object
217-
- `execute`
218-
- Hook into the before/after of this phase
219-
- Extend the execution context
220-
- Access to all execution parameters
221-
- Replace the execute function
222-
- Access to the results / error of the execution
223-
- Access to before / after resolvers calls
224-
- Extend resolvers behavior
225-
- Access resolvers parameters
226-
- Replace / modify the execution result
227-
- `subscribe`
228-
- Hook into the before/after of this phase
229-
- Extend the execution context
230-
- Access to all execution parameters
231-
- Replace the execute function
232-
- Access to the results / error of the execution
233-
- Access to before / after resolvers calls
234-
- Extend resolvers behavior
235-
- Access resolvers parameters
236-
- Replace / modify the subscription result
237-
238-
We also allow you to change the GraphQL schema during execution - so if your server has a schema that could change dynamically, you can always update it. As a result, we trigger `schemaChange` event that allow plugins respond accordingly.
167+
[For a complete guide and API docs for custom plugins, please refer to Envelop website](https://www.envelop.dev/docs/plugins)
239168

240169
### Contributing
241170

website/docs/README.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and collaborate on GraphQL-related plugins while filling the missing pieces in G
99

1010
`envelop` aims to extend the GraphQL execution flow by adding plugins that enrichs the feature set of your application.
1111

12+
* Docs & Plugins Hub: [envelop.dev](https://www.envelop.dev/)
13+
1214
## Key Concepts
1315

1416
#### Plugins & community

website/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"start": "next start"
1212
},
1313
"dependencies": {
14+
"date-fns": "2.22.1",
1415
"@chakra-ui/icons": "1.0.13",
1516
"@chakra-ui/react": "1.6.3",
1617
"@chakra-ui/system": "1.6.7",
@@ -21,7 +22,7 @@
2122
"@guild-docs/client": "0.2.10",
2223
"@guild-docs/server": "0.2.5",
2324
"@mdx-js/react": "1.6.22",
24-
"@theguild/components": "1.3.0",
25+
"@theguild/components": "1.3.1",
2526
"esbuild": "0.12.8",
2627
"framer-motion": "4.1.17",
2728
"fs-extra": "10.0.0",

website/public/style.css

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,11 @@ pre[class*='language-'] {
44
word-break: break-word !important;
55
}
66

7-
code {
8-
font-family: 'Source Code Pro', monospace !important;
9-
}
10-
11-
code * {
12-
font-family: 'Source Code Pro', monospace !important;
7+
code, code * {
8+
overflow-x: auto; font-family: "SF Mono", Menlo, monospace;
139
}
1410

1511
article {
1612
width: 100%;
1713
overflow-x: auto;
18-
}
19-
20-
.remark-highlight {
21-
font-size: 0.8rem;
2214
}

website/src/lib/plugins.ts

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
export type Tags =
2+
| 'tracing'
3+
| 'metrics'
4+
| 'core'
5+
| 'error-handling'
6+
| 'security'
7+
| 'utilities'
8+
| 'performance'
9+
| 'caching'
10+
| 'dev-tools'
11+
| 'authentication'
12+
| 'authorization'
13+
| 'schema';
14+
15+
export type RawPlugin = {
16+
title: string;
17+
npmPackage: string;
18+
tags: Tags[];
19+
readme?: string;
20+
iconUrl?: string;
21+
};
22+
23+
export const pluginsArr: RawPlugin[] = [
24+
{
25+
title: 'useSentry',
26+
npmPackage: '@envelop/sentry',
27+
iconUrl: '/assets/logos/sentry.png',
28+
tags: ['tracing', 'metrics', 'error-handling'],
29+
},
30+
{
31+
title: 'useSchema',
32+
npmPackage: '@envelop/core',
33+
iconUrl: '/logo.png',
34+
tags: ['core'],
35+
},
36+
{
37+
title: 'useErrorHandler',
38+
npmPackage: '@envelop/core',
39+
iconUrl: '/logo.png',
40+
tags: ['core', 'error-handling'],
41+
},
42+
{
43+
title: 'useMaskedErrors',
44+
npmPackage: '@envelop/core',
45+
iconUrl: '/logo.png',
46+
tags: ['core', 'error-handling', 'security'],
47+
},
48+
{
49+
title: 'useExtendContext',
50+
npmPackage: '@envelop/core',
51+
iconUrl: '/logo.png',
52+
tags: ['core', 'utilities'],
53+
},
54+
{
55+
title: 'useLogger',
56+
npmPackage: '@envelop/core',
57+
iconUrl: '/logo.png',
58+
tags: ['core', 'utilities'],
59+
},
60+
{
61+
title: 'usePayloadFormatter',
62+
npmPackage: '@envelop/core',
63+
iconUrl: '/logo.png',
64+
tags: ['core', 'utilities'],
65+
},
66+
{
67+
title: 'useTiming',
68+
npmPackage: '@envelop/core',
69+
iconUrl: '/logo.png',
70+
tags: ['core', 'tracing', 'utilities'],
71+
},
72+
{
73+
title: 'useGraphQLJit',
74+
npmPackage: '@envelop/graphql-jit',
75+
iconUrl: '/assets/logos/graphql.png',
76+
tags: ['performance'],
77+
},
78+
{
79+
title: 'useParserCache',
80+
npmPackage: '@envelop/parser-cache',
81+
iconUrl: '/logo.png',
82+
tags: ['performance', 'caching'],
83+
},
84+
{
85+
title: 'useValidationCache',
86+
npmPackage: '@envelop/validation-cache',
87+
iconUrl: '/logo.png',
88+
tags: ['performance', 'caching'],
89+
},
90+
{
91+
title: 'useDepthLimit',
92+
npmPackage: '@envelop/depth-limit',
93+
iconUrl: '/logo.png',
94+
tags: ['performance', 'security'],
95+
},
96+
{
97+
title: 'useDataLoader',
98+
npmPackage: '@envelop/dataloader',
99+
iconUrl: '/assets/logos/graphql.png',
100+
tags: ['performance'],
101+
},
102+
{
103+
title: 'useApolloTracing',
104+
npmPackage: '@envelop/apollo-tracing',
105+
iconUrl: '/assets/logos/apollo.png',
106+
tags: ['dev-tools'],
107+
},
108+
{
109+
title: 'useOpenTelemetry',
110+
npmPackage: '@envelop/opentelemetry',
111+
iconUrl: '/assets/logos/opentelemetry.png',
112+
tags: ['tracing', 'metrics', 'error-handling'],
113+
},
114+
{
115+
title: 'useGenericAuth',
116+
npmPackage: '@envelop/generic-auth',
117+
iconUrl: '/assets/logos/generic_auth.png',
118+
tags: ['security', 'authentication', 'authorization'],
119+
},
120+
{
121+
title: 'useAuth0',
122+
npmPackage: '@envelop/auth0',
123+
iconUrl: '/assets/logos/auth0.png',
124+
tags: ['security', 'authentication', 'authorization'],
125+
},
126+
{
127+
title: 'useGraphQLModules',
128+
npmPackage: '@envelop/graphql-modules',
129+
iconUrl: 'https://www.graphql-modules.com/img/just-logo.svg',
130+
tags: ['schema', 'utilities', 'dev-tools'],
131+
},
132+
{
133+
title: 'useRateLimiter',
134+
npmPackage: '@envelop/graphql-middleware',
135+
iconUrl: '/assets/logos/rate_limiter.png',
136+
tags: ['schema', 'utilities', 'security'],
137+
},
138+
{
139+
title: 'useDisableIntrospection',
140+
npmPackage: '@envelop/disable-introspection',
141+
iconUrl: '/assets/logos/graphql.png',
142+
tags: ['utilities', 'security'],
143+
},
144+
{
145+
title: 'useFilterAllowedOperations',
146+
npmPackage: '@envelop/filter-operation-type',
147+
iconUrl: '/assets/logos/graphql.png',
148+
tags: ['utilities', 'security'],
149+
},
150+
{
151+
title: 'usePreloadAssets',
152+
npmPackage: '@envelop/preload-assets',
153+
iconUrl: '/assets/logos/assets.png',
154+
tags: ['utilities'],
155+
},
156+
{
157+
title: 'usePersistedOperations',
158+
npmPackage: '@envelop/persisted-operations',
159+
iconUrl: '/assets/logos/persisted_operations.png',
160+
tags: ['security', 'performance'],
161+
},
162+
{
163+
title: 'useHive',
164+
npmPackage: '@graphql-hive/client',
165+
iconUrl: 'https://the-guild.dev/static/shared-logos/products/hive.svg',
166+
tags: ['tracing', 'metrics', 'dev-tools'],
167+
},
168+
];

0 commit comments

Comments
 (0)