Release Notes
#
What's new in GraphbackThis file contains changes and migration steps for the Graphback project. Please follow individual releases for more information.
#
0.15.0#
New Features#
Bug Fixescreate-graphback
was not correctly creating a fullstack application (#1778) (685aa4c)- throw an error if relationship annotation are missing (#1766). This fixes #1604 where when no relationship annotation is defined, invalid input fields are added to input type.
When no relationship annotation is defined, invalid input fields are added to input type
#
0.14.1#
Bug Fixes#
0.14.0#
Migrating to 0.14.0#
Breaking ChangesGraphback 0.14 contains a lot of breaking changes that will improve and simplify your application code.
#
CRUD Mutation return types are nullablePreviously, the CRUD mutation resolvers did not allow returning null. These can now be null.
#
Changed annotation syntaxAll annotations now use a uniform syntax format: @annotation(foo 'bar')
that is similar to GraphQL Directives
Examples:
becomes:
becomes:
@crud
annotation#
Removed The @crud
model annotation has been removed. To specify CRUD configuration on your model use the @model
annotation.
becomes:
#
@graphback/runtime package is removedRuntime package should no longer be used in top level API. All functionalities were moved to the @graphback/core package.
NOTE: Users should never have runtime or core packages imported in their applications and interact with graphback package as aggregator
#
API code generation is no longer supportedIn 0.14.0 Graphback now supports runtime generation of your schema, resolvers and services.
Please manually remove your generated schema and resolver files.
Remove @graphback/codegen-resolvers
from your package.json
.
To use our runtime API, refer to the Runtime API documentation.
#
New runtime APIWe have removed the complicated multi-step runtime API so that you can create your Graphback API in a couple of lines.
If you were already using the runtime API, replace this:
With this:
For more advanced usage, refer to the Runtime API documentation.
#
Client code generation now generates all GraphQL documents into one file- Replace
outputPath
withoutputFile
in your client config - Delete previously generated client documents and rerun generate command
- Be sure to correct your documents path in your codegen config if you use GraphQL-Code-Generator
@db.primary
is removed, use @id
instead#
We have replaced the @db.primary
annotation with @id
.
@db.default
is removed, use @default
instead#
We have replaced the @db.default
annotation with @default
.
Now you can provide default values like this:
instead of
graphback db
CLI command to migrate database#
Removed We have removed the graphback db
command. Database migrations can be only executed from the codebase when application is started.
See Database Migrations on how to use the code-based migrations in your API.
graphback init
CLI command#
Removed We have removed the graphback init
command, this has been replaced by a newly added micro-cli create-graphback
.
#
Removed helper method to create CRUD servicesPreviously you would have done this to create your context and a CRUD service for every model:
Now you can create your services and data providers with like this:
For more advanced usage, refer to the Runtime API documentation.
graphback openapi
CLI command.#
Removed We have removed the graphback openapi
CLI command, but you can still use OpenAPI-to-GraphQL to create a GraphQL schema from your OpenAPI specification.
graphl-config
is not supported in graphql-serve
#
To use graphql-serve
now you must use a model file:
#
SchemaCRUDPlugin only has a single configuration optionWe have removed the fileName
and format
options from SchemaCRUDPlugin
. These can be inferred from the outputPath
:
format
option from ClientCRUDPlugin#
Remove The format option has been removed as you can specify the file extension in outputFile
.
#
DeprecatedPgKnexDBDataProvider
has been deprecated in favour ofKnexDBDataProvider
.
#
New Features- All client documents are now generated in a single file. The file's path is specified by the
outputFile
field in client config outputPath
in client config has been removed- Added new templates to graphback init commands. All templates now giving ability to add client side application.
- Added a new, simpler runtime API
- GraphbackPluginEngine accepts now object instead of arguments.
new GraphbackPluginEngine({schema})
- Provide full path to schema in the
SchemaCRUDPlugin
config optionoutputPath
- Support relationships with non-model GraphQL types.
- Create a new Graphback project using
create-graphback
#
0.13.0Invalid release
#
0.12.0#
New Features- Add fragment only mode (c1297e21)
- cli: add mongodb template option (ce304da8)
- add mongo-runtime template (6b313bf8)
#
Bug Fixes- Print schema with directives (#1147) (2c72ddb0)
- Mongo batching for types (7ea4b6d4)
- Mongo batching with string as key (#1130) (e49d03a8)
- Add additional assign for the crud modifiers (660d2a53)
- Problem with CRUD config being global (fc138d27)
- check for undefined ID value (34021a20)
- throw error when no ID is supplied (1256f71d)
- accept globs and array of globs for model option in config (#1067) (2756b29a)
- Fix Pagination in Knex Provider (df469dc8)
- Fix pagination in MongoDB provider (7a8618e0)
- Add pagination to findBy queries (f0b8e1d5)
- Update LayeredRuntimeResolverCreator to use pagination in findall (b1a22846)
- Update CRUD services to use pagination in findall (33527825)
- resolvers: export generated code (eea38a5d)
#
0.11.4#
Bug Fixes- don't generate blank model file (ca29103e)
- remove generation of dbmigrations config in
graphback config
(f0b8ed4)
#
0.11.1- Fixed issue where root query type needed to properly created final schema.
- Remove serve from graphback-cli
#
0.11.0New features:
graphql-serve
- a fully functional GraphQL server based on Graphback and Apollo Server.- MongoDB support.
- Pagination support.
Other new features and changes documented in blog post: https://medium.com/@wtr/graphback-plugin-based-realtime-database-generator-78f4f608b81e
Breaking changes:
BREAKING:
@oneToMany
and@oneToOne
annotations are required to map relationships.BREAKING: Configuration format changed from
graphback.json
tographqlrc.yml
BREAKING: CRUDService api was changed to support per entity model
BREAKING: CRUDService api was changed to support per entity model
BREAKING: Runtime API was changed. Graphback package exports now GraphbackRuntime class to create runtime layer.
BREAKING: @model annotation is required for type to use generation
BREAKING: Removed GraphbackBackend and related interfaces.
BREAKING: Removed Production migrations engine
BREAKING: Removed directives for CRUD operations Graphback no longer uses GraphQL directives for controling generation of the CRUD operations. Users should use annotations
now becomes:
#
0.10.2#
graphql-migrationsIt's now possible to create database relationships from the 1:M
side of your data model!
@graphback/codegen-client @graphback/codegen-resolvers @graphback/codegen-schema @graphback/core @graphback/runtime graphql-migrations
#
Graphback-CLI#
Featuresgraphback openapi
command provides a way to migrate OpenAPI definition to GraphQL schema
#
Graphback#
Features- Support for Interfaces in GraphQL schema GraphQL Schema now supports interfaces that can be used to ensure consistency of the data. Example:
NOTE: Interfaces will not be taken into consideration when generating resolvers and database
#
0.8.3 (29th August, 2019)#
Templates#
Fixes- Removed redis-subscriptions and use im-memory graphql-subscriptions instead.
#
Graphback-cli#
Fixes- Removed redis dependency from docker-compose.
#
0.8.2 (28th August, 2019)#
Graphback-cli#
Fixes- Fixed instructions for missing watch command and replaced it with develop
- Fixed issue with not cleaning template and dist folders
- Disabled the GraphQL-JS template due to invalid resolver format.
#
0.8.1 (28th August, 2019)#
Graphback#
Fixes- Fixed npm release missing template files
#
0.8.0 (28th August, 2019)#
Graphback#
Features- Added ability to generate client side queries according to data model.
#
Graphback-cli#
Fixes- Removed dependency from docker when using sqlite3, changed redis subscriptions to inmemory subscriptions.
#
Templates#
Fixes- Changed scripts of templates.
#
0.7.2 (20th August, 2019)#
Graphback-cli#
Fixes- Removed watch command from cli which caused a lot of bugs.
#
0.7.1 (20th August, 2019)#
Graphback#
Fixes- Fixed problem with creating tables for Int type
#
0.7.0 (12th August, 2019)#
Graphback#
Features- Added new
@disableGen
directive that allows user to disable CRUD operation for single type
#
Templates#
Features- Added new GraphQL-js starter template, that uses GraphQL.js library.
- Added ability to use custom templates
#
0.6.0 (7th August, 2019)#
Graphback-cli#
Features- Added support for SQLite database inside CLI
- Added new Tasks model template
#
Fixes- Configuration in template works now with different databases that are supported by knex library
#
0.5.0 (1st August, 2019)#
Graphback#
Features- Added ability to perform CRUD generation based on configuration flags The generation will now be based on config.json file that will contain properties for all resolver types that need to generate. Please refer to the documentation for more information
- Added ability for custom Queries/Mutations/Subscriptions. Users can generate empty resolver stubs for their implementation.
#
Fixes- Modularized resolver output into separate files(based on types) instead of a single one. Also added custom resolvers.
#
Graphback-cli#
Fixes- Changed resolvers output format from a single resolver file to multiple files. Also added custom resolvers in generate
#
Templates#
Fixes- Dropped generated folder and change structure for template accordingly. Generated content will be now inside
src
folder instead.
#
0.4.0 (25 July, 2019)#
Templates#
FeaturesAdded Sofa (https://github.com/Urigo/SOFA/) template that allows generating restful API along with GraphQL one.
#
0.3.2 (24 July, 2019)#
Graphback#
Features- Added relationship support to schema and resolvers.
#
0.3.1 (17 July, 2019)#
Graphback#
Fixes- Strict typing in resolvers.
#
Templates#
Fixes- Added ts config and check compilation.
#
0.3.0 (16 July, 2019)#
Graphback#
Fixes- Revamp core to use visitor pattern
- Generate schema with opinionated schema patterns
- Edited resolvers implementations(working)
#
Deprecations- removed dependency of
graphql-codegen
version0.18.2
#
Graphback-cli#
Features- added
db
andwatch
command
#
Fixes- added more options in
init
command, to inject config
#
0.2.0 (12 June, 2019)#
Graphback#
Features- Initial
schema
andresolvers
generation
#
Graphback-cli#
Features- added
init
andgenerate
command