Allow options and Introspection on GraphQL API Beta

Hello,

My company is moving to Neo4j Aura.
We also use GraphQL.

However, the current beta system does not allow Instrospection (to check nodes, properties, etc). It also doesnt allow 'options' (e.g, options: { offset: 0, limit: 100 })

Please fix these 2 issues or we would struggle to migrate.
Also, please fix the docs for using the Graphql, I did not find them very helpful

Do you have a potential ETA for fixes?

Hi Joseph

You can enable / disable Introspection today using the Aura API and we're working on getting this option into the UI. I'll update you on when the UI work will be done.

If you want to do this using the Aura API, it's a bit more involved. Let me know if this is of interest to you.

For options, e.g limit , you can do this like this

query getAllMovies{
    movies(limit: 10) {
        name
    }
  }

What options are not working?

Also can you point to specific parts of the documentation that require improvement so that we can take action?

Thanks

Jonathan Giffard, PM Drivers & GraphQL.

1 Like

Hi

Hi Jonathan!

Thank you for your swift response. Sorry if I appeared curt, I was a little frustrated. As you’ve opened the gates to my questions, and appear quite responsive, I will suggest some changes. I mean these in the best spirit, as a fellow programmer who appreciates user feedback. QA on our own work is difficult at the best of times.

  1. I see the options formatting is a little different to native, but that's ok. I can change our querying. If you could add 'options' info to documentation, that would be useful. So, I can find and use it appropriately.
  2. When you go to the 'Graph QL API BETA' docs (linked in Neo4j Aura), you get to GraphQL for Neo4j AuraDB Beta - Neo4j GraphQL Library I think it should have very simple step-to step instructions for integration with Apollo, or other visualisation tools.
  3. I don't quite get why it has many confusing API setup steps described (though useful!), when I've come from a part of your app that allows a UI-based setup. Maybe have a clear section of ‘If you used UI-setup, CLICK HERE’ or something.
  4. We need introspection, what is the ETA? And how can I set it up?
  5. Most frustrating part: you NEED an instant-feedback system for ‘Type Definitions’ and very clear examples. It was near-impossible to figure out what was going on, as you modify the script, wait 60 seconds, and error is just ‘something is wrong’. Very difficult to debug.
    1. Maybe a ‘Click to test’ button?
    2. Maybe a UI-based system to begin with? ‘Type a node, its properties, click enter’ and user can see the template formed.

All in all, great app, and I love the ‘explore’ section. VERY cool! Good luck in everything, and if you could let me know ETAs for the above (or if even possible), I would appreciate it so I could pass it ups the chain on my end.

All the best,
Fellow Programmer
Joseph

1 Like

Hi Joseph,

We always welcome feedback on what we are doing and it is even more welcome when we're in a pre-production Beta phase.

Let me address the points you raised.

  • We are actively working on making the changes to the UI for toggling introspection on / off. The estimate is a week or so , ( not months ! ) for this to appear in the console.

  • I take your point on the current iteration of the docs. At the time when the Beta started this was the only way to manage the GraphQL APIs. Now that the UI is available, I'll work on updating the docs.

  • Instant feedback for Type Definitions is something we are very aware of and working on. This has turned out to be more complex than we first envisioned which means I don't yet have an E.T.A for you. As soon as I do, then I'll let you know.

If you would like introspection enabled now then we can do that behind the scenes for you. Please let me know the ID of the API and the associated Instance ID. You will find those when you select Data API Beta. in the Console. From the table that shows the list of Data APIs, there is a column for ID and another for Instance ID. Please DM me those and we will get introspection switched on.

If there's anything else, please let me know

Jonathan

1 Like

Hey Jonathan,

Sounds great!
Can you just ping me those commands and I'll plug them in on my end?
I am not sure how to DM you on here, or should I contact you on linkedin?
I can't seem to find them in the docs

All the best,

Joseph

Rather awkwardly, after looking around, I'm not sure of how to DM here so go ahead and message me on LinkedIn . I am at Jonathan Giffard - Neo4j | LinkedIn

To enable introspection yourself, you will need to use the Aura API and a CURL command. There's a number of steps to follow which I will write up and post here later today.


Thanks to @joseph.shepherd who field tested these instructions. I've made a change from the feedback to use aura-cli credential list rather than aura-cli config list


Here's what you need to do to set Introspection On / Off using the Aura API.

Although we will use CURL to enable / disable introspection, we will need to use the Aura CLI to get the Instance ID, the ID of the associated GraphQL API , and tell us the token to use with the Aura API.

Get the Aura CLI installed and configured by following the steps given in the GraphQL Beta Prerequisites

Onto finding the Instance ID. List all of your Aura instances using the table output which makes it easier to locate the ID

aura-cli instance list --output table

Make a note of the instance ID.

Now get the ID of the GraphQL API for that instance, changing YOUR_INSTANCE_ID for your value

aura-cli data-api graphql list --instance-id YOUR_INSTANCE_ID

Write down the ID of the GraphQL Data API

Finally, we need a token to auth to the Aura API. The Aura CLI caches these locally as the tokens last for 1 hour and there is no point in getting another one until it expires. This also avoids spamming the token endpoint.

You can see the token by asking the Aura CLI for it's configuration settings. Do this with

aura-cli credential list

This returns a JSON document that contains the current token as the value for the key access-token

Make a note of that as well

At this point you should have three items

  • ID of the GraphQL API
  • ID of the associated Aura Instance
  • A token for the Aura API

Here's the CURL command to set Instrospection on using those values

curl --location --request PATCH 'https://api.neo4j.io/v1beta5/instances/YOUR_AURA_INSTANCE_ID/data-apis/graphql/YOUR_GRAPHQL_API_ID' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_AURA_API_TOKEN ' \
--data '{
 "security": {
            "introspection_enabled": true
        }
  }
}'

To disable introspection, set the value to false

1 Like

Hi Jonathan,

Works when I run the below for the access-token:

aura-cli credentials list

If you now have the GraphQL ID and the ID of the Aura instance, just send them to me at jon.giffard@neo4j.com and I will get the change done at the backend

Updated the instructions to reflect that - thanks !

And , as of last week, introspection can be enabled / disabled in the AuraDB new console experience.