Skip to content

v1.9.0

Compare
Choose a tag to compare
@enisdenjo enisdenjo released this 24 Oct 23:29
· 589 commits to master since this release

1.9.0 (2020-10-24)

⚠️ Deprecated

Package has been renamed from graphql-transport-ws to graphql-ws.

Features

  • server: More callbacks, clearer differences and higher extensibility (#40) (507a222)

BREAKING CHANGES

Should've been a major release but semantic-release didn't detect the breaking changes of the 507a222 commit, so here we are...

This time we come with a few breaking changes that will open doors for all sorts of enhancements. Check the linked PR for more details.

Server option onSubscribe

  • Now executes before any other subscribe message processing
  • Now takes 2 arguments, the Context and the SubscribeMessage
  • Now returns nothing,ExecutionArgs or an array of GraphQLErrors
    • Returning void (or nothing) will leave the execution args preparation and validation to the library
    • Returned ExecutionArgs will be used directly for the GraphQL operation execution (preparations and validation should be done by you in this case)
    • Returned array of GraphQLErrors will be reported to the client through the ErrorMessage

Server option validationRules

Dropped in favour of applying custom validation rules in the onSubscribe callback. Find the recipe in the readme!

Server option formatExecutionResult

Dropped in favour of using the return value of onNext callback.