1.0.41 • Published 1 year ago

@bardouni/graphqly v1.0.41

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

1 year ago

1.0.40

1 year ago

1.0.41

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago