|
| 1 | +# How to contribute to graphql-http |
| 2 | + |
| 3 | +## Contributors license agreement |
| 4 | + |
| 5 | +This repository is managed by EasyCLA. |
| 6 | +Project participants must sign the free [GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution. |
| 7 | +You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/). |
| 8 | + |
| 9 | +To initiate the signature process please open a PR against this repo. |
| 10 | +The EasyCLA bot will block the merge if we still need a membership agreement from you. |
| 11 | +You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). |
| 12 | +If you have issues, please email [[email protected]](mailto:[email protected]). |
| 13 | + |
| 14 | +## Adding implementations |
| 15 | + |
| 16 | +[The implementations folder](implementations) contains setup for server implementations that allows checking their compliance with the [GraphQL over HTTP spec](https://graphql.github.io/graphql-over-http). |
| 17 | + |
| 18 | +Every implementation is expected to contain a `package.json` file with at least the following fields: |
| 19 | + |
| 20 | +```json |
| 21 | +{ |
| 22 | + "private": true, // prevents warnings |
| 23 | + "name": "implementation-name", // should be equivalent to the directory name |
| 24 | + "url": "https://implementation-name.example", // the official project URL |
| 25 | + "scripts": { |
| 26 | + "start": "node ." | "docker-compose up -d" // depending if the server can be run through node or Docker |
| 27 | + } |
| 28 | +} |
| 29 | +``` |
| 30 | + |
| 31 | +Depending on how your server is run, add it to the appropriate section of [.github/workflows/audits.yml](.github/workflows/audits.yml): |
| 32 | + |
| 33 | +- `node .`: `jobs.javascript.strategy.matrix.workspace` |
| 34 | +- `docker-compose up -d`: `jobs.docker.strategy.matrix.workspace` |
| 35 | + |
| 36 | +The script run in `start` is expected to bring up an HTTP server that listens to the port defined in the environment variable `$PORT`. |
| 37 | + |
| 38 | +After adding your directory and `package.json`, run `yarn install` to include the workspace. |
| 39 | + |
| 40 | +## Code formatting |
| 41 | + |
| 42 | +Run the following script to ensure the automatic code formatting is applied: |
| 43 | + |
| 44 | + yarn run lint:fix |
0 commit comments