Thanks for contributing to graphql-java!
Please be sure that you read the Code of Conduct before contributing to this project and please create a new Issue and discuss first what you are planning to do for larger changes.
The overall goal of graphql-java is to have a correct implementation of the GraphQL Spec in a production ready way.
In order to achieve that we have a strong focus on maintainability and high test coverage:
-
We expect new or modified unit test for every change (written in Spock).
-
Your code should be formatted with our IntelliJ graphql-java-code-style.
-
We don't add a new dependency to graphql-java: dependency conflicts will make adaption of graphql-java harder for users, therefore we avoid adding any new dependency.
-
graphql-java has a strict focus on executing a GraphQL request, this means JSON parsing, http communication, databases access etc is out of scope.
This repository enforces file compatibility and size standards through both local Git hooks and CI checks.
To install the pre-commit hook locally, run:
./scripts/setup-hooks.shThe pre-commit hook will automatically check for:
-
Windows-incompatible filenames: Files with characters that are reserved on Windows (< > : " | ? * ) will be rejected. This ensures the repository can be cloned on Windows systems.
-
Large files: Files larger than 10MB will be rejected. If you need to commit large files, consider:
- Splitting them into smaller parts (
.part1,.part2, etc.) - Reducing the file size
- Splitting them into smaller parts (
To bypass the hooks temporarily (not recommended), use git commit --no-verify.
The same checks are also enforced by the "Validate Files" GitHub Action on all pull requests and pushes. This ensures that even if the local hook is bypassed, incompatible files will be caught during CI.
If you have any question please consider asking in our Discussions. For bug reports or specific code related topics create a new issue.
Thanks!