Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

(fix) comma-separate properties from inlinefragment #115

Merged
merged 1 commit into from
Oct 1, 2018

Conversation

Duske
Copy link
Contributor

@Duske Duske commented Oct 1, 2018

When querying an inlinefragment, its properties are not separated by commas resulting in a invalid cypher query.
For example querying the props name and type of a CSVResource, which implements a Resource interface:

(resourcePool_resources:CSVResource) | resourcePool_resources {FRAGMENT_TYPE: "CSVResource", .name  .type }]

The bug is that we're looking at the tailSelections when checking for adding a comma, but the actual selections which need to be done are inside the inlinefragment. This is why I used fragmentSelections here.

When querying an inlinefragment, its properties are not separated by commas resulting in a invalid cypher query.
For example querying the props `name` and `type` of a `CSVResource`, which implements a `Resource` interface : 
```
(resourcePool_resources:CSVResource) | resourcePool_resources {FRAGMENT_TYPE: "CSVResource", .name  .type }]
```
The bug is that we're looking at the `tailSelections` when checking for adding a comma, but the actual selections which need to be done are inside the inlinefragment. This is why I used `fragmentSelections` here.
@Duske Duske mentioned this pull request Oct 1, 2018
@johnymontana johnymontana merged commit 4b7dff8 into neo4j-graphql:master Oct 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants