Releases: aerogear/graphback
1.0.0-beta4
1.0.0-beta3
1.0.0-beta2
1.0.0-beta1
Bug Fixes
- Logical
or
filter selector was not mapped correctly ingraphback-runtime-mongo
(#2034, fixed by 1ebe7e9) - Logical
or
filter selector was not mapped correctly ingraphback-runtime-knex
(#2034, fixed by 6d43f28) - Logical
or
predicate was not applied correctly increateInMemoryPredicateFilter
(#2034, fixed by 01f9912)
Breaking Changes
0.16.2
0.16.1
0.16.0
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 typeObjectID
. - #1731, #1626 Ineffecient and wrong mapping of the
-
Add a
@transient
field annotation to ignore fields during input type creation and migrations 4076fa26
DataSync
-
Using a
_lastUpdatedAt
field with a properGraphbackTimestamp
scalar and other minor fixes (#1771) including:- disabling conflicts in default configuration
- adding a
limit
argument tosync
Queries
Bug Fixes
-
Failure to map enum values in field directives (#1767), fixed by (a9ca21e1405dba14dab249af2f8d146ac2306803)
-
invalid input syntax for type timestamp: "null" (#1837), fixed by (37cdc1d12410a1fafb27877b97b54ea308acecb1)
-
Do not remove directives on Object Types in generated schema (#1767), fixed by (22c7a1da62e2752a21db4e4552e970aa93ba37ae)
-
Do not silently overrides createdAt/updatedAt custom fields when model contains @versioned annotation #1597
Breaking Changes
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
feat(context): move service map to context top-level (#1952) BREAKING
0.16.0-beta3
follow up to #1944 (#1950)
0.16.0-beta2
Fixes #1941
See full release notes - https://graphback.dev/docs/next/releases#016