You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`src/index.ts` is the handler function for the OpenWhisk action that uses GraphQL Mesh's platform agnostic HTTP Handler
6
+
-`.meshrc.yml` is the configuration file for GraphQL Mesh
7
+
-`package.json` is the package.json file that contains all the dependencies and scripts
8
+
-`build.js` is the code file that runs `ESBuild` to create a bundle for OpenWhisk deployment
9
+
10
+
## Configuring the project
11
+
12
+
GraphQL Mesh needs to be aware of the path of the OpenWhisk action endpoint.
13
+
So you need to configure `serve.endpoint` in `.meshrc.yml`;
14
+
15
+
```yaml
16
+
serve:
17
+
# This is the full path to your endpoint
18
+
# In the following endpoint, we assume you have created a package with `wsk package create mesh`
19
+
endpoint: /api/v1/web/guest/mesh/swapi/graphql
20
+
```
21
+
22
+
You also need to update the paths inside `index.ts` and `package.json` to match your OpenWhisk action name.
23
+
24
+
## Building the project for deployment
25
+
26
+
You can see an example script to bundle the project with `ESBuild` in `build.js`.
27
+
`yarn build`will build the artifacts of GraphQL Mesh first then bundle all the code needed for the OpenWhisk action by taking `index.ts` as an endpoint.
28
+
29
+
You can find the bundle in `dist/index.js` and deploy it either `yarn deploy` or manually with `wsk` like `wsk action update /guest/mesh/swapi --kind nodejs:16 dist/index.js`.
30
+
31
+
## Running the project locally
32
+
33
+
`start`command will start Mesh server to mimic your API endpoint locally without deployment;
0 commit comments