1.0.38 • Published 1 month ago

@bardouni/graphqly v1.0.38

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

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.json

Output

Graphqly will generate a GraphQL schema file (e.g., schema.gql).

type Query {
	hi(name: String!): String!
}
scalar Any

Specification

  • Field type is Any for null, undefined, void, or any.
  • Field type is optional Type for null|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.0.38

1 month ago

1.0.37

4 months ago

1.0.36

4 months ago

1.0.35

4 months ago

1.0.34

6 months ago

1.0.26

8 months ago

1.0.25

8 months ago

1.0.24

8 months ago

1.0.23

8 months ago

1.0.29

8 months ago

1.0.28

8 months ago

1.0.27

8 months ago

1.0.33

8 months ago

1.0.32

8 months ago

1.0.31

8 months ago

1.0.30

8 months ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago