1.0.43 • Published 1 year ago

@bardouni/graphqly v1.0.43

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year 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.43

1 year ago

1.0.42

1 year ago

1.0.39

2 years ago

1.0.40

2 years ago

1.0.41

2 years ago

1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.22

3 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago