Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 2.37 KB

CONTRIBUTING.md

File metadata and controls

58 lines (40 loc) · 2.37 KB

How to contribute to graphql-http

Contributors license agreement

This repository is managed by EasyCLA. Project participants must sign the free GraphQL Specification Membership agreement before making a contribution. You only need to do this one time, and it can be signed by individual contributors or their employers.

To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you. You can find detailed information here. If you have issues, please email [email protected].

Adding implementations

The implementations folder contains setup for server implementations that allows checking their compliance with the GraphQL over HTTP spec.

Every implementation is expected to contain a package.json file with at least the following fields:

{
  "private": true, // prevents warnings
  "name": "implementation-name", // should be equivalent to the directory name
  "url": "https://implementation-name.example", // the official project URL
  "scripts": {
    "start": "node ." | "docker compose up" // depending if the server can be run through Node.js or Docker
  }
}

Depending on how your server is run, add it to the appropriate section of .github/workflows/audits.yml:

  • Node.js: jobs.javascript.strategy.matrix.workspace
  • Docker: jobs.docker.strategy.matrix.workspace

The script run in start is expected to bring up an HTTP server that listens to the port defined in the environment variable $PORT.

After adding your directory and package.json, run yarn install to include the workspace.

You may run the audit on your implementation locally by first bringing up the server:

PORT=4000 yarn workspace <implementation> start

Then open another shell or move the prior process to the background and run:

PORT=4000 yarn tsx scripts/audit-implementation.ts implementations/<implementation>

Code formatting

Run the following script to ensure the automatic code formatting is applied:

yarn run lint:fix