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

Redefinition of same Relation by introspection data #316

Closed
martinheidegger opened this issue Jan 24, 2017 · 1 comment
Closed

Redefinition of same Relation by introspection data #316

martinheidegger opened this issue Jan 24, 2017 · 1 comment

Comments

@martinheidegger
Copy link
Contributor

martinheidegger commented Jan 24, 2017

When trying to run postgraphql against my db it exits with:

Error: Relation of name 'x' already exists between head collection 'y' and tail collection 'z' in the inventory.
    at Inventory.addRelation (/home/work/postgraphql/build/interface/Inventory.js:67:19)
    at _loop_1 (/home/work/postgraphql/build/postgres/inventory/addPgCatalogToInventory.js:59:23)
    at Object.addPgCatalogToInventory (/home/work/postgraphql/build/postgres/inventory/addPgCatalogToInventory.js:67:9)
    at Object.<anonymous> (/home/work/postgraphql/build/postgraphql/schema/createPostGraphQLSchema.js:57:32)
    at step (/home/work/tslib/tslib.js:114:27)
    at Object.next (/home/work/tslib/tslib.js:95:57)
    at fulfilled (/home/work/tslib/tslib.js:85:62)
    at process._tickCallback (internal/process/next_tick.js:103:7)z

Not sure what exactly causes it but I am pretty sure that this is not intended, is following line really a good idea? Wouldn't it be better to check for non-equality of the relation: I.e. if the same relation already exists, no problem but if someone tries to add a relation that is syntactically different: problem?!
https://github.com/calebmer/postgraphql/blob/3e24703584bb4baaa460da589b072408020a8e1c/src/interface/Inventory.ts#L79

@benjie
Copy link
Member

benjie commented Jan 24, 2017

@martinheidegger Could you provide a minimal schema that reproduces the issue?

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

Successfully merging a pull request may close this issue.

2 participants