You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `wrap` export has been removed. Since the types in `@graphql-ts/[email protected]` are compatible with the GraphQL.js types directly, these functions are no longer needed.
All of the GraphQL types returned by `@graphql-ts/schema` are now directly runtime compatible with the equivalent types from GraphQL.js instead of being on `.graphQLType`.
6
+
7
+
Handling this change should generally just require removing `.graphQLType` from where `@graphql-ts/schema` types are used with GraphQL.js, like this:
8
+
9
+
```diff
10
+
import { GraphQLSchema } from "graphql";
11
+
import { g } from "@graphql-ts/schema";
12
+
13
+
const Query = g.object()({
14
+
name: "Query",
15
+
fields: {
16
+
hello: g.field({
17
+
type: g.String,
18
+
resolve() {
19
+
return "Hello!";
20
+
},
21
+
}),
22
+
},
23
+
});
24
+
25
+
const schema = new GraphQLSchema({
26
+
- query: Query.graphQLType,
27
+
+ query: Query,
28
+
});
29
+
```
30
+
31
+
The types returned by `@graphql-ts/schema` are internally now extended classes of the equivalent types from GraphQL.js (though only in the types, at runtime they are re-exports). These new classes are exported from `@graphql-ts/schema/types` as `GObjectType` and etc. The constructors of the `G*` types can be used directly safely in place of `g.*` in **some cases** though some are not safe and it's still recommended to use `g.*` to also have binding to the same context type without needed to provide it manually.
0 commit comments