Skip to content

Commit

Permalink
new website (#4161)
Browse files Browse the repository at this point in the history
* bootstrap

* move docs/introduction

* move getting-started/overview and getting-started/your-first-mesh-gateway

* move combine multiple sources

* move sources-with-no-definition.mdx

* move comparison.mdx

* move customize-mesh-server.mdx, deploy-mesh-gateway.mdx, installation.mdx

* extending-unified-schema.mdx

* graphql-code-generator.mdx

* mesh-sdk.mdx

* live queries

* subscriptions-webhooks.mdx

* performances-best-practices.mdx

* error-handling.mdx

* file-uploads.mdx

* handlers-introduction.mdx

* graphql

* openapi.mdx

* cli-commands.mdx

* grpc and json-schema

* mongoose and mysql

* neo4j and odata

* postgraphile, soap, thrift.mdx, tuql

* transforms-introduction.mdx

* rename.mdx, prefix.mdx, encapsulate.mdx

* cache.mdx, snapshot.mdx, mock.mdx

* replace-field.mdx, filter-schema.mdx, resolvers-composition.mdx

* federation.mdx, type-merging.mdx, naming-convention.mdx

* extend.mdx, hoist.mdx, prune.mdx

* move cache

* move extend

* refactor index.mdx

* temp

* update website to react 18

* temp

* add api docs to docs/api/ folder, update nextra patches

* add api docs to docs/api/ folder, update nextra patches

* adjust theme.config

* update typedoc

* alphabetize meta

* use ```yaml

* unneeded escape

* escape comments

* generate-config-schema

* migrate to esm import syntax in mdx

* migrate to esm import syntax in mdx

* prettify

* replace to esm

* build api-docs

* new build api docs

* add docs/api to gitignore

* prettier

* update patch

* fix(algolia): migrate Algolia scripts to Nextra support (#4162)

* fix(algolia): migrate Algolia scripts to Nextra support

* fix(algolia): temp workflow fix

* fix: disable Nextra search

* chore: revert tmp fix for Algolia integrity workflow

* Update style.css

* fix

* fix

* fix

* fix

* prettier

Co-authored-by: Charly POLY <1252066+charlypoly@users.noreply.github.com>
  • Loading branch information
dimaMachina and charlypoly authored Jul 27, 2022
1 parent c88a34d commit c79f105
Show file tree
Hide file tree
Showing 172 changed files with 3,694 additions and 5,230 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ package-lock.json
.mesh
/.idea/
.next/
/website/api-sidebar.json
/website/docs/api
/website/src/pages/docs/api/
/.husky/_/
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.changeset/*.md
/website/docs/generated-markdown/
/website/src/generated-markdown/
/website/src/pages/docs/api/
.next/
dist/
.mesh/
Expand Down
4 changes: 2 additions & 2 deletions examples/graphql-file-upload-example/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"@apollo/client": "3.6.9",
"apollo-upload-client": "17.0.0",
"graphql": "16.5.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-scripts": "4.0.3",
"web-vitals": "2.1.4"
},
Expand Down
6 changes: 3 additions & 3 deletions examples/nextjs-apollo-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"apollo-server-micro": "2.25.4",
"graphql": "16.5.0",
"next": "12.2.3",
"react": "17.0.2",
"react-dom": "17.0.2"
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/react": "17.0.47",
"@types/react": "18.0.15",
"typescript": "4.7.4"
}
}
6 changes: 3 additions & 3 deletions examples/nextjs-sdk-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"apollo-server-micro": "2.25.4",
"graphql": "16.5.0",
"next": "12.2.3",
"react": "17.0.2",
"react-dom": "17.0.2"
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/react": "17.0.47",
"@types/react": "18.0.15",
"typescript": "4.7.4"
}
}
8 changes: 4 additions & 4 deletions examples/openapi-react-weatherbit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"private": true,
"dependencies": {
"graphql": "16.5.0",
"react": "17.0.2",
"react-dom": "17.0.2"
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@graphql-mesh/cli": "0.75.3",
"@types/react": "17.0.47",
"@types/react-dom": "17.0.17",
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
"@vitejs/plugin-react": "2.0.0",
"typescript": "4.7.4",
"vite": "3.0.3"
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"postinstall": "patch-package && husky install",
"prebuild:website": "yarn build && yarn build:api-docs",
"build:website": "cd website && yarn build",
"generate-config-schema": "graphql-to-config-schema --schema ./**/yaml-config.graphql --json ./packages/types/src/config-schema.json --typings ./packages/types/src/config.ts --markdown ./website/docs/generated-markdown/ && prettier --write ./packages/types/src && ts-node --compiler-options='{\"module\":\"commonjs\"}' scripts/escape-generated-markdown",
"generate-config-schema": "graphql-to-config-schema --schema ./**/yaml-config.graphql --json ./packages/types/src/config-schema.json --typings ./packages/types/src/config.ts --markdown ./website/src/generated-markdown && prettier --write ./packages/types/src",
"prebuild": "yarn generate-config-schema",
"transpile-ts": "tsc --project tsconfig.build.json",
"build": "yarn transpile-ts && bob build",
Expand Down Expand Up @@ -54,9 +54,9 @@
"patch-package": "6.4.7",
"prettier": "2.7.1",
"ts-jest": "28.0.7",
"typedoc": "0.22.13",
"typedoc-plugin-markdown": "3.11.14",
"typedoc-plugin-rename-defaults": "0.4.0",
"typedoc": "0.23.1",
"typedoc-plugin-markdown": "3.13.3",
"typedoc-plugin-rename-defaults": "0.6.4",
"typescript": "4.7.4"
},
"husky": {
Expand All @@ -68,12 +68,13 @@
"packages/**/src/**/*.{ts,tsx}": [
"eslint --fix"
],
"**/*.{ts,tsx,graphql,yml,json,md,mdx,js}": [
"**/*.{ts,tsx,graphql,yml,json,md,js}": [
"prettier --write"
]
},
"workspaces": {
"packages": [
"./website",
"./packages/*",
"./packages/cache/*",
"./packages/handlers/*",
Expand All @@ -83,7 +84,6 @@
"./examples/*",
"./examples/federation-example/*",
"./examples/graphql-file-upload-example/frontend",
"./website",
"./packages/loaders/*"
]
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cache/file/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

Now you can basically use Cloudflare Workers' KV Caching system within Mesh;

```yml
```yaml
cache:
cfKv:
namespace: MESH
Expand Down
2 changes: 1 addition & 1 deletion packages/cache/redis/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

Now you can basically use Cloudflare Workers' KV Caching system within Mesh;

```yml
```yaml
cache:
cfKv:
namespace: MESH
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/serve/yaml-config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type ServeConfig @md {
endpoint: String
"""
Path to the browser that will be used by `mesh serve` to open a playground window in development mode
This feature can be disable by passing `false`
This feature can be disabled by passing `false`
"""
browser: Browser
"""
Expand Down
4 changes: 2 additions & 2 deletions packages/config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@
sourceName: Author
sourceTypeName: Query
sourceFieldName: authorById
requiredSelectionSet: "{ id }"
requiredSelectionSet: '{ id }'
sourceArgs:
id: "{root.id}"
id: '{root.id}'
```
After:
Expand Down
4 changes: 2 additions & 2 deletions packages/handlers/graphql/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
- 66f5d0189: **New `credentials` configuration option**

Previously it wasn't possible to configure `credentials` of outgoing `Request` object passed to `fetch`. And the default behavior was `same-origin`.
Now it is possible to configure it and you can also remove it completely for the environments (e.g. CF Workers) to avoid errors like `'credentials' hasn't been implemented yet` etc.
Now it is possible to configure it, and you can also remove it completely for the environments (e.g. CF Workers) to avoid errors like `'credentials' hasn't been implemented yet` etc.

```yml
```yaml
graphql:
endpoint: ...
credentials: disable
Expand Down
2 changes: 1 addition & 1 deletion packages/handlers/graphql/yaml-config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type GraphQLHandlerHTTPConfiguration @md {
webSocketImpl: String
"""
Path to the introspection
You can seperately give schema introspection
You can separately give schema introspection
"""
introspection: String
"""
Expand Down
5 changes: 3 additions & 2 deletions packages/handlers/json-schema/yaml-config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,23 @@ type JsonSchemaHTTPOperation implements JsonSchemaBaseOperation {
"""
responseSchema: Any
"""
Did you use Sample? Provide the respone sample path.
Did you use Sample? Provide the response sample path.
"""
responseSample: Any
"""
Inset any name for the type of the response body.
"""
responseTypeName: String

"""
You can define your response schemas by status codes;
```yaml
responseByStatusCode:
200:
responseSchema: ./someschema.json#/somepath
404:
responseSample: ./error-sample.json
responseTypeName: MyError
```
"""
responseByStatusCode: Any

Expand Down
4 changes: 2 additions & 2 deletions packages/handlers/soap/yaml-config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type SoapHandler @md {
The fields of the object will be the operations of the port.
Most soap-endpoints only define one port; so including it in the schema will just be inconvenient.
But if there are multiple ports with operations of the same name, you should set this option to true.
Otherwise only one of the identical-named operations will be callable.
Otherwise, only one of the identical-named operations will be callable.
default: false
"""
includePorts: Boolean
Expand All @@ -43,7 +43,7 @@ type SoapHandler @md {
The fields of the object will be the ports of the service (or the operation, dependent on 'includePorts').
Most soap-endpoints only define one service; so including it in the schema will just be inconvenient.
But if there are multiple services with operations of the same name, you should set this option to true.
Otherwise only one of the identical-named operations will be callable.
Otherwise, only one of the identical-named operations will be callable.
default: false
"""
includeServices: Boolean
Expand Down
10 changes: 5 additions & 5 deletions packages/loaders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ You can consume this `GraphQLSchema` inside any tools in GraphQL Ecosystem such

### GraphQL Config

GraphQL Config is a way of specifying your GraphQL Project in a standard way so the most of tools around GraphQL Ecosystem can recognize your project such as VSCode GraphQL Extension, GraphQL ESLint and GraphQL Code Generator
GraphQL Config is a way of specifying your GraphQL Project in a standard way so the most of the tools around GraphQL Ecosystem can recognize your project such as VSCode GraphQL Extension, GraphQL ESLint and GraphQL Code Generator

```yml
```yaml
schema: ./packages/server/modules/**/*.graphql # Backend
documents: ./packages/client/pages/**/*.graphql # Frontend
```
Omnigraph acts like as a custom loader with GraphQL Config
```yml
```yaml
schema:
MyOmnigraph:
loader: '@omnigraph/openapi' # This provides GraphQLSchema to GraphQL Config
Expand All @@ -30,7 +30,7 @@ Let's say we want to create a type-safe SDK from the generated schema using Grap
Like any other GraphQL project. We can use `extensions.codegen`

```yml
```yaml
schema:
MyOmnigraph:
loader: '@omnigraph/openapi' # This provides GraphQLSchema to GraphQL Config
Expand Down Expand Up @@ -112,7 +112,7 @@ export default function loadSchemaFromBundle() {

And use our new loader in GraphQL Config by replacing `loader`

```yml
```yaml
schema:
MyOmnigraph:
loader: ./load-schema-from-bundle.js # This provides GraphQLSchema to GraphQL Config
Expand Down
2 changes: 1 addition & 1 deletion packages/loaders/json-schema/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@

- b69746d2c: feat(json-schema): new exposeResponseMetadata flag to expose the details of the HTTP responses received from the upstream

```yml
```yaml
responseSchema: ...
exposeResponseMetadata: true
```
Expand Down
2 changes: 1 addition & 1 deletion packages/loaders/json-schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This package generates GraphQL Schema from JSON Schema and sample JSON request and responses. You can define your root field endpoints like below in your GraphQL Config for example;

```yml
```yaml
schema:
myOmnigraph:
loader: '@omnigraph/json-schema'
Expand Down
6 changes: 3 additions & 3 deletions packages/loaders/raml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This package generates `GraphQLSchema` instance from **RAML API Document** (`.raml`) file located at a URL or FileSystem by resolving the JSON Schema dependencies. It uses `@omnigraph/json-schema` by generating the necessary configuration.

```yml
```yaml
schema:
myOmnigraph:
loader: "@omnigraph/raml"
loader: '@omnigraph/raml'
ramlFilePath: https://www.my-api.com/api.raml
operationHeaders:
Authorization: Bearer {context.apiToken}
Authorization: Bearer {context.apiToken}
```
2 changes: 1 addition & 1 deletion packages/plugins/response-cache/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

Now you can basically use Cloudflare Workers' KV Caching system within Mesh;

```yml
```yaml
cache:
cfKv:
namespace: MESH
Expand Down
8 changes: 4 additions & 4 deletions packages/plugins/response-cache/yaml-config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ type ResponseCacheConfig {
Return a unique value for each session.
Creates a global session by default.
Example;
```yml
```yaml
sessionId: "{context.headers.userId}"
```
"""
sessionId: String
"""
Specify whether the cache should be used based on the context.
```yml
```yaml
if: "context.headers.userId != null"
```
"""
Expand All @@ -50,7 +50,7 @@ type ResponseCacheConfig {
Customize the behavior how the response cache key is computed from the documentString, variableValues, contextValue and sessionId.
If the given string is interpolated as empty, default behavior is used.
Example;
```yml
```yaml
# Cache by specific value
cacheKey: "{variableValues.userId}"
Expand All @@ -71,7 +71,7 @@ type ResponseCacheConfig {

"""
Checks if the result should be cached.
```yml
```yaml
shouldCacheResult: "result.errors.length > 0"
```
"""
Expand Down
18 changes: 10 additions & 8 deletions packages/transforms/cache/yaml-config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ type CacheTransformConfig @md {
field: String!
"""
Cache key to use to store your resolvers responses.
The default is: {typeName}-{fieldName}-{argsHash}-{fieldNamesHash}
The default is: `{typeName}-{fieldName}-{argsHash}-{fieldNamesHash}`
Available variables:
- {args.argName} - use resolver argument
- {typeName} - use name of the type
- {fieldName} - use name of the field
- {argsHash} - a hash based on the 'args' object
- {fieldNamesHash} - a hash based on the field names selected by the client
- {info} - the GraphQLResolveInfo of the resolver
- `{args.argName}` - use resolver argument
- `{typeName}` - use name of the type
- `{fieldName}` - use name of the field
- `{argsHash}` - a hash based on the 'args' object
- `{fieldNamesHash}` - a hash based on the field names selected by the client
- `{info}` - the GraphQLResolveInfo of the resolver
Available interpolations:
- {format|date} - returns the current date with a specific format
- `{format|date}` - returns the current date with a specific format
"""
cacheKey: String
"""
Expand Down
3 changes: 1 addition & 2 deletions packages/transforms/federation/yaml-config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ type ResolveReferenceObject {
"""
queryFieldName: String!
"""
If the root field name has multiple args,
you need to define which argument should receive the key
If the root field name has multiple args, you need to define which argument should receive the key
"""
keyArg: String
}
Expand Down
4 changes: 2 additions & 2 deletions packages/transforms/mock/yaml-config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ type MockingFieldConfig {
Faker.js expression or function
Read more (https://github.com/marak/Faker.js/#fakerfake)
Example:
faker: name.firstName
faker: "{{ name.firstName }} {{ name.lastName }}"
faker: `name.firstName`
faker: `{{ name.firstName }} {{ name.lastName }}`
"""
faker: String
"""
Expand Down
2 changes: 1 addition & 1 deletion packages/transforms/rate-limit/yaml-config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type RateLimitTransformConfig @md {
"""
ttl: Int!
"""
The identifier expression that determines the identity of the request (e.g. "{context.req.socket.remoteAddress}")
The identifier expression that determines the identity of the request (e.g. `{context.req.socket.remoteAddress}`)
"""
identifier: String!
}
Loading

1 comment on commit c79f105

@vercel
Copy link

@vercel vercel bot commented on c79f105 Jul 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.