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

How do I _force_ a field to be returned #604

Open
jruts opened this issue Apr 8, 2021 · 1 comment
Open

How do I _force_ a field to be returned #604

jruts opened this issue Apr 8, 2021 · 1 comment

Comments

@jruts
Copy link

jruts commented Apr 8, 2021

Hi,

I am currently experimenting with this library but I ran into an issue/question that I need some help with to get a better understanding.

I want to present the question with a simple example.

Here is a graphql query snippet that is connected to a neo4j database

{
  Product{
     name
   }
}

It's fairly simple, get me all names of the products in neo4j with the Product label, and that works.

Here is where it gets tricky

{
  Product{
    name
    description
  }
}

The description is something I need to fetch from another source, so I am writing a custom resolver for that, which is not an issue. The issue is that it depends on the product_no field of the product in neo4j.
I can easily just add this field into the query and receive it, and it will be available in the resolver to get the description from the other source.

The question here is: is there a way to always get certain query fields back even without specifying them into the query?
In this case I always want the product_no to be returned in the resolver, even if I don't want to return it to the person who is not querying for it.

I hope that made some sense and thank you for reading through it!

@michaeldgraham
Copy link
Collaborator

#608

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants