Skip to content
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
2 changes: 1 addition & 1 deletion .changeset/afraid-geckos-bow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"@graphql-ts/schema": major
---

The following types are now deprecated and have replacements as follows:
The following types have been replaced as follows:

- `ObjectType` -> `GObjectType`
- `EnumType` -> `GEnumType`
Expand Down
2 changes: 1 addition & 1 deletion .changeset/purple-beers-mate.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"@graphql-ts/schema": major
---

The `g` export exported from `@graphql-ts/schema` directly is now deprecated. Using `gWithContext` is now the recommended way to use `@graphql-ts/schema` instead of the instance of `g` exported by `@graphql-ts/schema` or creating multiple files to setup `g` though using those is still possible.
The `g` and `graphql` exports from `@graphql-ts/schema` have been removed. You should now use `gWithContext` to bind `g` to a specific context type.

```ts
import { GraphQLSchema } from "graphql";
Expand Down
4 changes: 0 additions & 4 deletions packages/schema/api-with-context/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/schema/api-without-context/package.json

This file was deleted.

19 changes: 1 addition & 18 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
"module": "./dist/graphql-ts-schema.esm.js",
"default": "./dist/graphql-ts-schema.cjs.js"
},
"./api-with-context": {
"types": "./api-with-context/dist/graphql-ts-schema-api-with-context.cjs.js",
"module": "./api-with-context/dist/graphql-ts-schema-api-with-context.esm.js",
"default": "./api-with-context/dist/graphql-ts-schema-api-with-context.cjs.js"
},
"./api-without-context": {
"types": "./api-without-context/dist/graphql-ts-schema-api-without-context.cjs.js",
"module": "./api-without-context/dist/graphql-ts-schema-api-without-context.esm.js",
"default": "./api-without-context/dist/graphql-ts-schema-api-without-context.cjs.js"
},
"./package.json": "./package.json"
},
"files": [
Expand All @@ -36,12 +26,5 @@
"devDependencies": {
"graphql": "^16.3.0"
},
"repository": "https://github.com/Thinkmill/graphql-ts/tree/main/packages/schema",
"preconstruct": {
"entrypoints": [
"index.ts",
"api-with-context/index.ts",
"api-without-context/index.ts"
]
}
"repository": "https://github.com/Thinkmill/graphql-ts/tree/main/packages/schema"
}
5 changes: 0 additions & 5 deletions packages/schema/src/api-with-context/api-with-context.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/schema/src/api-with-context/api-with-context.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/schema/src/api-with-context/index.ts

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions packages/schema/src/api-without-context/api-without-context.js

This file was deleted.

84 changes: 0 additions & 84 deletions packages/schema/src/api-without-context/index.ts

This file was deleted.

73 changes: 0 additions & 73 deletions packages/schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,76 +123,3 @@ export {
type InferValueFromArgs,
type InferValueFromInputType,
} from "./types";
export { g } from "./schema-api";

export type {
Arg,
EnumType,
InputObjectType,
InputType,
NullableInputType,
ListType,
NonNullType,
ScalarType,
} from "./api-without-context";

import type {
GArg,
GField,
GFieldResolver,
GInputType,
GInterfaceField,
GInterfaceType,
GNullableOutputType,
GNullableType,
GObjectType,
GOutputType,
GType,
GUnionType,
} from "./types";

/** @deprecated Use {@link GField} instead */
export type Field<
Source,
Args extends { [Key in keyof Args]: GArg<GInputType> },
Type extends GOutputType<Context>,
SourceAtKey,
Context,
> = GField<Source, Args, Type, SourceAtKey, Context>;
/** @deprecated Use {@link GFieldResolver} instead */
export type FieldResolver<
Source,
Args extends Record<string, GArg<GInputType>>,
Type extends GOutputType<Context>,
Context,
> = GFieldResolver<Source, Args, Type, Context>;

/** @deprecated Use {@link GInterfaceField} instead */
export type InterfaceField<
Args extends Record<string, GArg<GInputType>>,
Type extends GOutputType<Context>,
Context,
> = GInterfaceField<Args, Type, Context>;
/** @deprecated Use {@link GInterfaceType} instead */
export type InterfaceType<
Source,
Fields extends Record<
string,
GInterfaceField<any, GOutputType<Context>, Context>
>,
Context,
> = GInterfaceType<Source, Fields, Context>;
/** @deprecated Use {@link GNullableOutputType} instead */
export type NullableOutputType<Context> = GNullableOutputType<Context>;
/** @deprecated Use {@link GObjectType} instead */
export type ObjectType<Source, Context> = GObjectType<Source, Context>;
/** @deprecated Use {@link GOutputType} instead */
export type OutputType<Context> = GOutputType<Context>;
/** @deprecated Use {@link GUnionType} instead */
export type UnionType<Source, Context> = GUnionType<Source, Context>;
/** @deprecated Use {@link GType} instead */
export type Type<Context> = GType<Context>;
/** @deprecated Use {@link GNullableType} instead */
export type NullableType<Context> = GNullableType<Context>;

export * from "./schema-api-alias";
6 changes: 2 additions & 4 deletions packages/schema/src/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import type {
GraphQLInputFieldConfig,
GraphQLScalarTypeConfig,
} from "graphql";
import type {
InferValueFromArgs,
InferValueFromInputType,
} from "./api-without-context";
import {
GArg,
GEnumType,
Expand All @@ -33,6 +29,8 @@ import {
GType,
GUnionType,
InferValueFromOutputType,
InferValueFromArgs,
InferValueFromInputType,
} from "./types";
import {
GraphQLBoolean,
Expand Down
28 changes: 0 additions & 28 deletions packages/schema/src/schema-api-alias.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/schema/src/schema-api-alias.js

This file was deleted.

Loading