Skip to content

Releases: ThreadsStyling/apollo-resolver-types

v3.5.0

19 Jul 08:51
3c08650
Compare
Choose a tag to compare

3.5.0 (2023-07-19)

Features

v3.4.1

10 Nov 10:28
e957a57
Compare
Choose a tag to compare

3.4.1 (2022-11-10)

Bug Fixes

  • 🐛 added support for composite keys (#34) (e957a57)

v3.4.0

07 Dec 14:46
43e935c
Compare
Choose a tag to compare

3.4.0 (2021-12-07)

Features

  • 🎸 disable unique directive per location rule (#31) (43e935c)

v3.3.0

24 Jul 14:55
9efd984
Compare
Choose a tag to compare

3.3.0 (2020-07-24)

Features

  • open source apollo-resolver-types (#19) (9efd984)

v3.2.0

13 Jul 08:55
52bfe46
Compare
Choose a tag to compare

3.2.0 (2020-07-13)

Features

  • use parameter-reducers to clarify parameter parsing (#15) (52bfe46)

v3.1.0

16 Apr 16:29
5b67d52
Compare
Choose a tag to compare

3.1.0 (2020-04-16)

Features

v3.0.0

03 Mar 09:49
6ef6a07
Compare
Choose a tag to compare

3.0.0 (2020-03-03)

Bug Fixes

BREAKING CHANGES

When upgrading TypeScript you will get an error. This is due to a breaking change in TypeScript which led to a naming collision (see Local and Imported Type Declarations Now Conflict)

Option 1

You will need to add typesPrefix: I to the config: section of your codegen.yml file and rename the import from GeneratedTypes.Resolvers to GeneratedTypes.IResolvers.

codegen.yml

 schema: ./schema.graphql
 overwrite: true
 generates:
   ./__generated__/types.ts:
     plugins:
       - add:
           placement: 'prepend'
           content: |+
             /* tslint:disable */
             // This file was automatically generated and should not be edited.
             import ResolverContext from '../ResolverContext';
       - typescript
       - typescript-resolvers
     config:
       federation: true
       contextType: ResolverContext
+      typesPrefix: I
       mappers:
         User: ../types/nodes#User
         Sale: ../types/nodes#Sale

ResolverTypes.ts

  import ApolloResolverTypes from '@threads/apollo-resolver-types';
  import * as GeneratedTypes from './__generated__/types';

- type ResolverTypes = ApolloResolverTypes<GeneratedTypes.Resolvers>;
+ type ResolverTypes = ApolloResolverTypes<GeneratedTypes.IResolvers>;

  export default ResolverTypes;

Option 2

Alternatively you can just update the config:

 schema: ./schema.graphql
 overwrite: true
 generates:
   ./__generated__/types.ts:
     plugins:
       - add:
           placement: 'prepend'
           content: |+
             /* tslint:disable */
             // This file was automatically generated and should not be edited.
             import ResolverContext from '../ResolverContext';
       - typescript
       - typescript-resolvers
     config:
       federation: true
       contextType: ResolverContext
       mappers:
-        User: ../types/nodes#User
+        User: ../types/nodes#User as DbUser
-        Sale: ../types/nodes#Sale
+        Sale: ../types/nodes#Sale as DbSale

The point is to make sure that the two types don't conflict:

  1. The generated types for the objects returned from the GraphQL API and for user inputs (mainly used in tests)
  2. The types for the data returned from the database that are passed as the first parameter to resolvers

These two types cannot have the same names as each other.

v2.3.1

14 Nov 18:00
93b771c
Compare
Choose a tag to compare

2.3.1 (2019-11-14)

Bug Fixes

  • queued updates could create infinite loop in wach mode (#9) (93b771c)

v2.3.0

14 Nov 16:20
37c41c7
Compare
Choose a tag to compare

2.3.0 (2019-11-14)

Features

v2.2.0

23 Oct 14:15
1950594
Compare
Choose a tag to compare

2.2.0 (2019-10-23)

Features

  • validate GraphQL schemas so we get clear error messages (#7) (1950594)