What is the main purpose of Graphitron?
The main goal of Graphitron is to automate repetitive patterns in API development, particularly creating resolvers for GraphQL APIs. It generates code based on GraphQL schemas tied to database models using GraphQL directives.
How does Graphitron work?
Graphitron operates through a code generation process:
-
Input:
-
GraphQL schema(s) with special directives that map to your database structure.
-
jOOQ-generated classes representing your database schema.
-
-
Processing: analyses the schema and the database class representation to understand the relationships between GraphQL types and database tables.
-
Output: generates Java code that implements GraphQL resolvers handling queries and mutations, with efficient database access via jOOQ.
Under the hood, Graphitron uses:
-
graphql-java for the GraphQL implementation.
-
jOOQ for type-safe SQL generation and database interaction.
This eliminates the need to write repetitive resolver code while maintaining type safety and query efficiency. For more on those choices, see Dependencies.
Is Graphitron free to use?
Yes. The tool is open source. jOOQ uses dual licensing; commercial databases require a commercial jOOQ license. See Dependencies for details.
What are the key advantages of using Graphitron?
Graphitron enhances code quality and maintainability by:
-
Automating repetitive patterns.
-
Reducing code duplication.
-
Minimising hand-written errors.
-
Optimising for managing a large graph.
For the design philosophy behind these choices, see Graphitron Principles.
Has Graphitron been used in production?
Yes. Graphitron was initially built for the FS GraphQL API, a core component in the Norwegian Student Information System (SIS). You can explore that API in Voyager.
Where can I find documentation?
Beyond this site:
-
Source repository on GitHub.
-
Getting Started for the rewrite-side build flow (hello world, custom scalars, federation).
-
Architecture for contributors working on the generator itself.
How can I contribute?
Contributions are welcome. Open an issue or PR at github.com/sikt-no/graphitron. The Roadmap shows what’s in flight and where new work fits.
Where can I get support?
Open an issue at github.com/sikt-no/graphitron.