Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic error: operation hook returned 'undefined' with Byid queries #4

Closed
dgkm opened this issue May 13, 2019 · 2 comments
Closed

Logic error: operation hook returned 'undefined' with Byid queries #4

dgkm opened this issue May 13, 2019 · 2 comments

Comments

@dgkm
Copy link

dgkm commented May 13, 2019

We are getting an error "Logic error: operation hook returned 'undefined'." when no record found with any "*ById" query on any table.

This error seems to be coming from "graphql/oprational-hooks".

Environment to reproduce the issue:

  • run the postgraphile with the following hooks:
    makePluginHook([OperationHooks, PgPubsub, subscriptionsLds]);
  • execute *ById query on any table passing non existing record *id to reproduce the error

Example to reproduce:

Table:

CREATE TABLE account ( "id" serial primary key, "firstName" text, "lastName" text, "dateOfBirth" date, "createdAt" timestamptz not null default now(), "updatedAt" timestamptz not null default now() )

Sample Request:

Note: Any non existing record id, example id = 10, a non existing record.

{ accountById(id: 10) { id } }

Sample Response:

{ "errors": [ { "message": "Logic error: operation hook returned 'undefined'.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "accountById" ], "extensions": { "messages": [] } } ], "data": { "accountById": null } }

@benjie, Please let me know if you need any further information to reproduce the issue.

@nickreese
Copy link

Hitting this issue as well.

@benjie
Copy link
Member

benjie commented Feb 17, 2020

This is fixed in @graphile/operation-hooks@0.2.4 👍

@benjie benjie closed this as completed Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants