From 93d7a47a71ffe71260252421a8e744dd3fc15761 Mon Sep 17 00:00:00 2001 From: Emma Hamilton <git@emmas.town> Date: Fri, 31 Jan 2025 15:51:29 +1000 Subject: [PATCH] README and package.json updates --- README.md | 39 +----------------------------------- packages/extend/package.json | 1 + packages/schema/README.md | 38 +++++++++++++++++++++++++++++++++++ packages/schema/package.json | 1 + 4 files changed, 41 insertions(+), 38 deletions(-) mode change 100644 => 120000 README.md create mode 100644 packages/schema/README.md diff --git a/README.md b/README.md deleted file mode 100644 index 7b919d5..0000000 --- a/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# graphql-ts - -`@graphql-ts/schema` is a thin wrapper around -[GraphQL.js](https://github.com/graphql/graphql-js) providing type-safety for -constructing GraphQL Schemas while avoiding type-generation, [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) -and [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html). - -```ts -import { graphql } from "@graphql-ts/schema"; -import { GraphQLSchema, graphql as runGraphQL } from "graphql"; - -const Query = graphql.object()({ - name: "Query", - fields: { - hello: graphql.field({ - type: graphql.String, - resolve() { - return "Hello!"; - }, - }), - }, -}); - -const schema = new GraphQLSchema({ - query: Query.graphQLType, -}); - -runGraphQL({ - source: ` - query { - hello - } - `, - schema, -}).then((result) => { - console.log(result); -}); -``` diff --git a/README.md b/README.md new file mode 120000 index 0000000..e6f7879 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +packages/schema/README.md \ No newline at end of file diff --git a/packages/extend/package.json b/packages/extend/package.json index 956a96e..23ea08c 100644 --- a/packages/extend/package.json +++ b/packages/extend/package.json @@ -1,6 +1,7 @@ { "name": "@graphql-ts/extend", "version": "1.0.0", + "description": "Utilities to extend existing GraphQL schemas with @graphql-ts/schema", "main": "dist/graphql-ts-extend.cjs.js", "module": "dist/graphql-ts-extend.esm.js", "exports": { diff --git a/packages/schema/README.md b/packages/schema/README.md new file mode 100644 index 0000000..1163367 --- /dev/null +++ b/packages/schema/README.md @@ -0,0 +1,38 @@ +# @graphql-ts/schema + +`@graphql-ts/schema` is a thin wrapper around +[GraphQL.js](https://github.com/graphql/graphql-js) providing type-safety for +constructing GraphQL Schemas while avoiding type-generation, [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) +and [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html). + +```ts +import { graphql } from "@graphql-ts/schema"; +import { GraphQLSchema, graphql as runGraphQL } from "graphql"; + +const Query = graphql.object()({ + name: "Query", + fields: { + hello: graphql.field({ + type: graphql.String, + resolve() { + return "Hello!"; + }, + }), + }, +}); + +const schema = new GraphQLSchema({ + query: Query.graphQLType, +}); + +runGraphQL({ + source: ` + query { + hello + } + `, + schema, +}).then((result) => { + console.log(result); +}); +``` diff --git a/packages/schema/package.json b/packages/schema/package.json index 4103b5b..275b5fb 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,7 @@ { "name": "@graphql-ts/schema", "version": "0.6.0", + "description": "Type-safety for constructing GraphQL schemas in TypeScript", "main": "dist/graphql-ts-schema.cjs.js", "module": "dist/graphql-ts-schema.esm.js", "exports": {