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

Mesh - new website #4161

Merged
merged 60 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
283a35c
bootstrap
dimaMachina Jul 11, 2022
996285f
move docs/introduction
dimaMachina Jul 11, 2022
89f0172
move getting-started/overview and getting-started/your-first-mesh-gat…
dimaMachina Jul 11, 2022
fa1e0c2
move combine multiple sources
dimaMachina Jul 11, 2022
7bd5dbf
move sources-with-no-definition.mdx
dimaMachina Jul 11, 2022
098906d
move comparison.mdx
dimaMachina Jul 11, 2022
86bdab6
move customize-mesh-server.mdx, deploy-mesh-gateway.mdx, installation…
dimaMachina Jul 13, 2022
538e9e9
extending-unified-schema.mdx
dimaMachina Jul 13, 2022
3847180
graphql-code-generator.mdx
dimaMachina Jul 13, 2022
d486bc7
mesh-sdk.mdx
dimaMachina Jul 13, 2022
731a7ee
live queries
dimaMachina Jul 13, 2022
581727b
subscriptions-webhooks.mdx
dimaMachina Jul 13, 2022
6f045e4
performances-best-practices.mdx
dimaMachina Jul 13, 2022
46b83c4
error-handling.mdx
dimaMachina Jul 13, 2022
77ca626
file-uploads.mdx
dimaMachina Jul 13, 2022
e71e92c
handlers-introduction.mdx
dimaMachina Jul 13, 2022
bd1647f
graphql
dimaMachina Jul 13, 2022
c5dc9cf
openapi.mdx
dimaMachina Jul 13, 2022
0600dab
cli-commands.mdx
dimaMachina Jul 13, 2022
65cba91
grpc and json-schema
dimaMachina Jul 13, 2022
d0840dc
mongoose and mysql
dimaMachina Jul 13, 2022
db2570c
neo4j and odata
dimaMachina Jul 13, 2022
74bf22c
postgraphile, soap, thrift.mdx, tuql
dimaMachina Jul 13, 2022
ae0814f
transforms-introduction.mdx
dimaMachina Jul 13, 2022
677bade
rename.mdx, prefix.mdx, encapsulate.mdx
dimaMachina Jul 13, 2022
8082d60
cache.mdx, snapshot.mdx, mock.mdx
dimaMachina Jul 13, 2022
be3cf73
replace-field.mdx, filter-schema.mdx, resolvers-composition.mdx
dimaMachina Jul 13, 2022
7bababd
federation.mdx, type-merging.mdx, naming-convention.mdx
dimaMachina Jul 13, 2022
00af8c2
extend.mdx, hoist.mdx, prune.mdx
dimaMachina Jul 13, 2022
105cd57
move cache
dimaMachina Jul 13, 2022
ae92b0c
move extend
dimaMachina Jul 13, 2022
daaa72e
refactor index.mdx
dimaMachina Jul 13, 2022
c43c17a
temp
dimaMachina Jul 13, 2022
e941c6b
update website to react 18
dimaMachina Jul 13, 2022
94818a2
temp
dimaMachina Jul 13, 2022
1a3aadc
add api docs to docs/api/ folder, update nextra patches
dimaMachina Jul 16, 2022
112ee90
add api docs to docs/api/ folder, update nextra patches
dimaMachina Jul 16, 2022
110c988
adjust theme.config
dimaMachina Jul 16, 2022
a214b4c
update typedoc
dimaMachina Jul 16, 2022
fb4452b
alphabetize meta
dimaMachina Jul 16, 2022
3c8fe4d
use ```yaml
dimaMachina Jul 16, 2022
b0ddb1d
unneeded escape
dimaMachina Jul 16, 2022
24b27c8
escape comments
dimaMachina Jul 16, 2022
2f6e5bc
generate-config-schema
dimaMachina Jul 17, 2022
73214be
migrate to esm import syntax in mdx
dimaMachina Jul 17, 2022
da4e97e
migrate to esm import syntax in mdx
dimaMachina Jul 17, 2022
737d363
prettify
dimaMachina Jul 17, 2022
096f8a2
replace to esm
dimaMachina Jul 17, 2022
ec55498
build api-docs
dimaMachina Jul 17, 2022
99a66cf
new build api docs
dimaMachina Jul 17, 2022
0a00c7e
add docs/api to gitignore
dimaMachina Jul 17, 2022
31124c3
prettier
dimaMachina Jul 17, 2022
43600e4
update patch
dimaMachina Jul 17, 2022
a0c08a5
fix(algolia): migrate Algolia scripts to Nextra support (#4162)
charlypoly Jul 18, 2022
8630bd3
Update style.css
dimaMachina Jul 19, 2022
4ef301a
fix
dimaMachina Jul 27, 2022
8e123e3
fix
dimaMachina Jul 27, 2022
d7ca3cb
fix
dimaMachina Jul 27, 2022
1165479
fix
dimaMachina Jul 27, 2022
d504967
prettier
dimaMachina Jul 27, 2022
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
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