- f585fb3: Support TypeScript ESM module resolution. More information on https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#ecmascript-module-support-in-node-js
- f555f2f: GraphQL v16 compatibility
- 31ef74b: fix esm support for create-react-app and webpack
-
c2dee5a: Support sending extensions from the client to the server.
client.execute({ operation, extensions: { secret: "I like turtles!" } });
The GraphQL over HTTP specification allows to send a extensions object as part of a GraphQL request to the server. This is now also supported. Possible use-cases might be access tokens or protocol extensions such as Automatic Persisted Queries.
- 8e14fd2: improve ESM support by using export fields and .mjs file extensions
- 5ca93e3: correctly detect the main operation of the sent graphqll document
- df4f39b: Return AsyncIterableIterator for the execution result instead of taking a sink as an argument.
- 24028bf: feat: add validationRules option for overwriting validationRules without overwriting validate.
- 10a110e: Update Socket.io to version 3
- 7b37628: Remove support for the
onError
handler. - 7b37628: Accept
DocumentNode
objects as the execution input.
- 8d416b8: make graphql a peer dependency
- 7b37628: Make implementation more conform with how
graphql-express
behaves.
-
f1b7a18: Replace
executeLiveQuery
withexecute
.Instead of passing two execute functions to the server options, now only a single execute function is passed to the server.
The
execute
function can now return aAsyncIterableIterator<ExecutionResult>
.@n1ru4l/socket-io-graphql-server
has no longer a dependency upon@n1ru4l/graphql-live-query
.
-
b086fc8: Shape the API to be more "compatible" with graphql-js.
BREAKING CHANG Rename
InMemoryLiveQueryStore.triggerUpdate
method toInMemoryLiveQueryStore.invalidate
.InMemoryLiveQueryStore.invalidate
now also accepts an array of strings.BREAKING CHANGE
InMemoryLiveQueryStore
no longer implementsLiveQueryStore
. TheLiveQueryStore
interface was removedBREAKING CHANGE Rename
InMemoryLiveQueryStore.register
toInMemoryLiveQueryStore.execute
.InMemoryLiveQueryStore.execute
returns aAsyncIterableIterator
which publishes the execution results.
- Updated dependencies [b086fc8]
- @n1ru4l/[email protected]
- bb822cd: The client now also sends the operationName to the server if provided. The
operationName
is now also optional.
-
dda2325: accept an empty variables value as the payload.
-
6a03905: BREAKING CHANGE: Change API of
LiveQueryStore
.The register method of the
LiveQueryStore
now has changed:import type { DocumentNode, ExecutionResult } from "graphql"; export type UnsubscribeHandler = () => void; export type OperationVariables = { [key: string]: any } | null | undefined; export abstract class LiveQueryStore { abstract async triggerUpdate(identifier: string): Promise<void>; abstract register( operationDocument: DocumentNode, operationVariables: OperationVariables, executeQuery: () => Promise<ExecutionResult>, publishUpdate: (executionResult: ExecutionResult, payload: any) => void ): UnsubscribeHandler; }
- Updated dependencies [6a03905]
- @n1ru4l/[email protected]
-
66b9261: Allow lazy registration of the GraphQL layer on a socket basis. This is useful for use-cases where authentication must be done BEFORE any GraphQL operations could be executed.
const socketIOGraphQLServer = registerSocketIOGraphQLServer({ socketServer, isLazy: true }); socketServer.on("connection", socket => { socket.on("auth", message => { validateAuth(message); // allow consuming the GraphQL API if authentication passes. const dispose = socketIOGraphQLServer.registerSocket(socket); // disable consuming the GraphQL API for the given socket. dispose(); // you could also do the following for disposing instead: socketIOGraphQLServer.disposeSocket(socket); }); });
- aa2be73: chore: unify how packages are built.
- Updated dependencies [aa2be73]
- @n1ru4l/[email protected]