Replies: 2 comments
-
Hi @Bilal-S ! Do you want to create a PR and update the actual documentation that lives on our website? The docs are here: https://github.com/Urigo/graphql-mesh/tree/master/website/docs/getting-started (you can just add a new file and we'll add that to the website). Then @ardatan can review it. Also, we are currently working on v1 of Mesh with improved cli commands, but that's definitely a great place to start with. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@dotansimha @ardatan |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Team:
I have attempted to document the CLI and added observations while working with it. I would appreciate feedback on style as well as accuracy based what I was able to extract from the code.
GraphQL-Mesh Commands
Graphql-mesh exposes a number of commands that can be used to determine interactions as well as startup behavior.
When running mesh commands please be aware that some will work differently based on the context you are executing them in. Global installed CLI vs local CLI do not return the exact same results in all circumstances.
Global installation:
If you have a global install of the cli and you can use
graphql-mesh
in terminal directly.As indicated the result of the command may differ based on whether you run the global CLI command or the locally installed CLI inside your target project's root directory.
The safest method is the local execution.
To run project specific commands CLI:
[TODO:verify]
In that case a script reference inside your
package.json
file may be more practicalGlobal Options
All commands can take generally two options. Options are marked with a double dash
--
while commands themselves do not have a prefix. Global options are not required.r, alias: require [array]
Loads specific require.extensions before running the codegen and reading the configuration.
Examples
dir [string]
Modified the base directory to use for looking for meshrc config file.
Examples
Command List
serve
Serves a GraphQL server with GraphQL interface to test your Mesh API. Can have an optional port argument.
Options
port [number]
The system port on which graphql-mesh will be made available. This should be one of the normal system ports [1-65386] not currently used by any other service.
Example
generate-sdk
Generates fully type-safe SDK based on unified GraphQL schema and GraphQL operations.
Options
output [string] - required
The target output file.
operations [array]
[need example]
depth [number]
The recursion depth of operations.
flatten-types [boolean]
Whether types should be flattened.
Example
[TODO:verify]
dump-schema
Generates a JSON introspection or GraphQL SDL schema file from your mesh. Output format will depend on your output file name extension.
Options
output [string] - required
The target file name, which should either have a
.json
or.graphql
extension. Alternate supported file extension are:graphqls
,gql
,gqls
.Examples
typescript
Generates TypeScript typings for the generated mesh.
Options
output [string] - required
The target file name, which should have a
.d.ts
extension.Example
write-introspection-cache
Writes introspection cache and creates it from scratch. The filename and directory are resolved from your
.meshrc.yaml
directives:Example
Beta Was this translation helpful? Give feedback.
All reactions