Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Releases: aerogear/graphback

1.0.0-beta4

21 Sep 15:17
Compare
Choose a tag to compare
1.0.0-beta4 Pre-release
Pre-release

Bug Fixes

  • Fix TypeError: Cannot read property 'page' of undefined error in CRUDService (#2095 fixed by 5143fb6)
  • It was not possible to map a WHERE X IS/IS NOT NULL query in the Knex query mapper (#2095 fixed by d10e918)

1.0.0-beta3

21 Sep 08:33
2cb0902
Compare
Choose a tag to compare
1.0.0-beta3 Pre-release
Pre-release

Features

  • Added ability to override package name in plugin config (#2077, fixed by 4cfd68c)

1.0.0-beta2

18 Sep 10:53
2f3e6ae
Compare
Choose a tag to compare
1.0.0-beta2 Pre-release
Pre-release

Bug Fixes

  • GraphQL Migrations did not read auto-incrementing info from database column (#2017, fixed by 83a80cd)
  • Prevent creation of empty Subscription, Query, Mutation resolver objects (#2073, fixed by 97e826)

1.0.0-beta1

15 Sep 12:28
94a04fe
Compare
Choose a tag to compare
1.0.0-beta1 Pre-release
Pre-release

Bug Fixes

  • Logical or filter selector was not mapped correctly in graphback-runtime-mongo (#2034, fixed by 1ebe7e9)
  • Logical or filter selector was not mapped correctly in graphback-runtime-knex (#2034, fixed by 6d43f28)
  • Logical or predicate was not applied correctly in createInMemoryPredicateFilter (#2034, fixed by 01f9912)

Breaking Changes

0.16.2

07 Sep 14:27
Compare
Choose a tag to compare

Bug Fixes

  • Primary key with ID ScalarType and field name different to id isn't auto-incrementable. Fixed in #1997
  • Logical OR operator is not working correctly in MongoDB query builder. (#1963), fixed by (059a0ae)

0.16.1

02 Sep 07:47
Compare
Choose a tag to compare

Bug Fixes

  • Correct main file and types paths of graphql-serve package (d4d918e).

0.16.0

01 Sep 10:48
97ac02a
Compare
Choose a tag to compare

New Features

  • Use any knex 0.20.x or 0.21.x version in your application (d826b6f#1903)

  • Ability to specify composite unique columns in GraphQL Migrations (#1658), fixed by (9c6f34a231e2645c34533d58ea4427ff8f8f634e)

  • Requiring _id: GraphbackObjectID primary key for MongoDB (#1769).
    This fixes issues below related to primary key in MongoDB:

    • #1731, #1626 Ineffecient and wrong mapping of the id field
    • #1625 Filters on "id: ID" field not working

    NOTE: If you are migrating from 0.15 or previous versions of Graphback, you may be required to update relationship fields so that their values (previous stored as String) are of type ObjectID.

  • Add a @transient field annotation to ignore fields during input type creation and migrations 4076fa26

DataSync

  • Using a _lastUpdatedAt field with a proper GraphbackTimestamp scalar and other minor fixes (#1771) including:

    • disabling conflicts in default configuration
    • adding a limit argument to sync Queries

Bug Fixes

Breaking Changes

  • Use GraphbackDateTime scalar for generated createdAt updatedAt fields (#1349, fixed by #1862)

Disable filter input generation for unknown custom scalars

Graphback disabled generation of unknown custom scalars, except for Timestamp, Time, Date, DateTime, as we cannot reliably support scalars we do not know.

See Graphback Scalars for the list of officially supported scalars.

  • Replace @db(skip: true) field annotation with @transient 85d50f3c

Changed GraphbackCRUDService findBy method signature. This also applies to all services that implement this interface.

- findBy(filter: QueryFilter<Type>, context: GraphbackContext, page?: GraphbackPage, orderBy?: any): Promise<ResultList<Type>>;
+ findBy(args?: FindByArgs, context?: GraphbackContext, info?: GraphQLResolveInfo, path?: string): Promise<ResultList<Type>>;

args

findBy now accepts a new interface, FindByArgs, which wraps the filter, page and orderBy optional arguments.

await noteService.findBy({
  filter: {
    id: {
      gt: 100
    }
  },
  page: {
    offset: 0,
    limit: 10
  },
  orderBy: {
    field: 'id'
  }
})

context (optional)

The context parameter is now optional.

info

You can now optionally pass the GraphQLResolveInfo info object to the CRUD service, to perform extra optimizations like retrieving only the selected fields from the query.

await noteService.findBy(filter, context, info);

path (optional)

The root path of the query to get the selected fields from. For example, to get id, title, description fields from the following query, you would set the path to items.

query findNotes {
  findNotes {
    items {
      id
      title
      description
    }
  }
} 

The path variable is optional, as it will automatically resolve to the root field of the entire query.

context parameter removed from subscribeToCreate, subscribeToDelete, subscribeToUpdate methods in GraphbackCRUDService.

This method was unused.

Removed context parameter from all GraphbackDataProvider methods. This also applies to all providers that implement this interface.

All CRUD methods in GraphbackDataProvider had a context parameter used to get the selected fields.
These have been replaced with (optional) selectedFields - you can pass a string array of the fields you want to select from the database.

await noteProvider.findBy(filter, ['id', 'name']);

Changed GraphbackDataProvider findBy method signature. This also applies to all providers that implement this interface.

args

findBy now accepts a new interface, FindByArgs, which wraps the filter, page and orderBy optional arguments.

await noteService.findBy({
  filter: {
    id: {
      gt: 100
    }
  },
  page: {
    offset: 0,
    limit: 10
  },
  orderBy: {
    field: 'id'
  }
})

Remove resolver options from GraphbackContext

Resolver options (context.graphback.options) was removed from the context because the count aggregation and selectedFields extraction logic was moved to the CRUDService method.

Removed graphback key from GraphbackContext

The graphback.services property has been removed from GraphbackContext, and graphback is now the service map property.

export interface GraphbackContext {
-  graphback: {
-    graphback: GraphbackServiceConfigMap
-  }
+  graphback: GraphbackServiceConfigMap
}

Now you can reach the Graphback service map by calling context.graphback.Note.findBy(...).

CRUDService, DataSyncCRUDService now accepts a ModelDefinition as the first constructor parameter.

To instantiate a CRUDService you must pass the full ModelDefinition instead of the model name.

const myService = new CRUDService(modelDefinition, ...);

KeycloakCrudService now accepts a ModelDefinition as the first constructor parameter.

To instantiate a CRUDService you must pass the full ModelDefinition instead of the model name.

const myService = new KeycloakCrudService(modelDefinition, ...);

DataSyncProvider sync method signature has been changed

- sync(lastSync: Date, context: GraphbackContext, filter?: any, limit?: number): Promise<Type[]>;
+ sync(lastSync: Date, selectedFields?: string[], filter?: QueryFilter, limit?: number): Promise<Type[]>;

The context argument has been replaced with (optional) selectedFields.

context parameter is removed from the create method in MongoDBDataProvider and DatasyncMongoDBDataProvider providers.

This parameter did not do anything.

0.16.0-beta4

27 Aug 17:28
65df6ac
Compare
Choose a tag to compare
0.16.0-beta4 Pre-release
Pre-release
feat(context): move service map to context top-level (#1952)

BREAKING

0.16.0-beta3

27 Aug 10:59
6f463db
Compare
Choose a tag to compare
0.16.0-beta3 Pre-release
Pre-release
follow up to #1944 (#1950)

0.16.0-beta2

26 Aug 11:42
Compare
Choose a tag to compare
0.16.0-beta2 Pre-release
Pre-release