Skip to content

Commit

Permalink
[WIP] Explore adding the ability to emit JSON representation of Grats…
Browse files Browse the repository at this point in the history
…' analysis as well as resolver map (#157)

* Add draft spec for JavaScript Resolver Directive Spec

* [WIP] Use resolver directive spec

Summary:

Test Plan:

* Try resolver signatures in json


Summary:

Test Plan:

* [Demo] Try using @resolver directive in example project, [Demo] Try using resolver signature in demo app


Summary:

Test Plan:
Summary:

Test Plan:

* [WIP] Split out codegen


Summary:

Test Plan:

* Add experimental option to emit resolver map

Summary:

Test Plan:

* Remove spec docs

* Cleanup

* More cleanup


Summary:

Test Plan:

* Tidy

* Add note to changelog

* Remove unused import

* Update website Grats code
  • Loading branch information
captbaritone authored Dec 7, 2024
1 parent 7b83249 commit cf42522
Show file tree
Hide file tree
Showing 228 changed files with 1,930 additions and 1,380 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Changes in this section are not yet released. If you need access to these change
- **Features**
- Custom error messages when types or interfaces are missing fields which suggests adding a `@gqlField` docblock tag.
- Custom error message when your project has no types defined. Intended to help guide new users.
- **Improvements**
- Better import deduplication in generated TypeScript code
- ## **Bug Fixes**

## 0.0.29
Expand Down
16 changes: 4 additions & 12 deletions examples/production-app/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@
* Executable schema generated by Grats (https://grats.capt.dev)
* Do not manually edit. Regenerate by running `npx grats`.
*/
import { id as likeIdResolver } from "./graphql/Node";
import { id as userIdResolver } from "./graphql/Node";
import { id as postIdResolver } from "./graphql/Node";
import { nodes as postConnectionNodesResolver } from "./models/PostConnection";
import { nodes as likeConnectionNodesResolver } from "./models/LikeConnection";
import { likes as queryLikesResolver } from "./models/LikeConnection";
import { node as queryNodeResolver } from "./graphql/Node";
import { nodes as queryNodesResolver } from "./graphql/Node";
import { posts as queryPostsResolver } from "./models/PostConnection";
import { nodes as userConnectionNodesResolver } from "./models/UserConnection";
import { users as queryUsersResolver } from "./models/UserConnection";
import { id as likeIdResolver, id as userIdResolver, id as postIdResolver, node as queryNodeResolver, nodes as queryNodesResolver } from "./graphql/Node";
import { nodes as postConnectionNodesResolver, posts as queryPostsResolver } from "./models/PostConnection";
import { nodes as likeConnectionNodesResolver, likes as queryLikesResolver, postLikes as subscriptionPostLikesResolver } from "./models/LikeConnection";
import { nodes as userConnectionNodesResolver, users as queryUsersResolver } from "./models/UserConnection";
import { Viewer as queryViewerResolver } from "./models/Viewer";
import { createLike as mutationCreateLikeResolver } from "./models/Like";
import { createPost as mutationCreatePostResolver } from "./models/Post";
import { createUser as mutationCreateUserResolver } from "./models/User";
import { postLikes as subscriptionPostLikesResolver } from "./models/LikeConnection";
import { GraphQLSchema, GraphQLObjectType, GraphQLInt, GraphQLList, GraphQLNonNull, GraphQLString, GraphQLScalarType, GraphQLID, GraphQLInterfaceType, GraphQLBoolean, GraphQLInputObjectType } from "graphql";
export function getSchema(): GraphQLSchema {
const DateType: GraphQLScalarType = new GraphQLScalarType({
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"semver": "^7.5.4"
},
"devDependencies": {
"@graphql-tools/utils": "^9.2.1",
"@types/node": "^18.14.6",
"@types/semver": "^7.5.6",
"@typescript-eslint/eslint-plugin": "^5.55.0",
Expand Down
101 changes: 77 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cf42522

Please sign in to comment.