Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README and package.json updates #20

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
1 change: 1 addition & 0 deletions packages/extend/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
38 changes: 38 additions & 0 deletions packages/schema/README.md
Original file line number Diff line number Diff line change
@@ -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);
});
```
1 change: 1 addition & 0 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down