@bardouni/graphqly v1.0.43
Graphqly
Features
Generate a GraphQL schema directly from your TypeScript code. Supports both Types and Classes.
If you've worked with APIs, GraphQL, and Relay, you know that the code-first approach can be time-consuming. Graphqly simplifies this by generating a GraphQL schema based on your TypeScript resolvers.
This project is a work in progress. Pull requests are welcome. Check the tests folder for more examples.
How to Use
Step 1: Create Your TypeScript Definitions
Create a TypeScript file (e.g., def.ts) and export a class like Query Mutation.
export class Query {
hi({name: string}){
return "hi " + name;
}
}Step 2: Generate GraphQL Schema
Run Graphqly with the required parameters.
yarn graphqly run --definition ./def.ts --destination ./out.gql --tsconfig tsconfig.jsonOutput
Graphqly will generate a GraphQL schema file (e.g., schema.gql).
type Query {
hi(name: String!): String!
}
scalar AnySpecification
- Field type is
Anyfor null, undefined, void, or any. - Field type is optional
Typefornull|Type,undefined|Type,void|Type. - All exported classes are included in the generated GraphQL schema.
- Types are automatically converted to interfaces when extended.
- If an extended class is not exported, the extension will be ignored.
- If an extended class is not exported, the extension will be ignored.
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago