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

Strange behavior with fragments #186

Open
mvid opened this issue Jul 23, 2019 · 1 comment
Open

Strange behavior with fragments #186

mvid opened this issue Jul 23, 2019 · 1 comment

Comments

@mvid
Copy link

mvid commented Jul 23, 2019

We are seeing some strange behavior with null fields and fragments.

Here is an example:

fragment ChildPackage on Package {
  qid # non-null field
  name
  address {
    qid
  }
}

And this is the query:

query Recipient {
	qid
	name
	packages {
		...ChildPackage 
		packages {
			...ChildPackage    
			packages {
				...ChildPackage    
				}
			}
		}
	}
}

In this particular example, we expect to get two items in the top level packages response, and then the follow up packages to be empty. However, what we get are in the top level packages is an array with two null values in it. However, when we expand fragment into the query like this:

query Recipient {
	qid
	name
	packages {
		qid # non-null field
		name
		address {
			qid
		}
		packages {
			...ChildPackage    
			packages {
				...ChildPackage    
				}
			}
		}
	}
}

Then we get the expected response, two Package entities with empty packages arrays returned in them.

Why is the response between a fragment and it's exact same fields different? Also, the double null response seems incorrect, maybe it is related to the null expansion issue in #80

Any thoughts?

@johnymontana
Copy link
Member

@mvid Could you try these queries against the experimental endpoint http://localhost:7474/graphql/experimental/ and see if you have the same behavior?

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

2 participants