Skip to content

Rework getting started pages #273

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

Open
wants to merge 9 commits into
base: 7.x
Choose a base branch
from
Open

Conversation

rsill-neo4j
Copy link
Contributor

No description provided.

Comment on lines +45 to +46
Alternatively, if you already have data in the AuraDB, you can obtain your type definitions via the https://graphql-toolbox.neo4j.io[Neo4j GraphQL Toolbox].
The toolbox can connect to the AuraDB and automatically create type definitions and allow GraphQL operations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note we want to have the introspection feature in the Aura console soon, so this will need to be updated to reflect that when it's added.

=== Authentication providers

All requests to the GraphQL API are authenticated and there are two options for the type of authentication: API key or JSON Web Key Set (JWKS).
It is possible to use these in combination and have multiples of each.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Liam-Doodson just to double check, we only allow use of a single authentication provider per query, right?

That may need to be reflected here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah in a single request to the api, you can only use a single auth provider. However, the api can be configured multiple different auth providers e.g. on one request you can use an api key, the next request use a jwt and then maybe a different api key on a third request

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rephrased

rsill-neo4j and others added 3 commits July 4, 2025 10:18
@neo4j-docops-agent
Copy link
Collaborator

This PR includes documentation updates
View the updated docs at https://neo4j-docs-graphql-273.surge.sh

New pages:

Updated pages:

For every query and mutation that is executed against this generated schema, the Neo4j GraphQL Library generates a single Cypher query which is executed against the database.
This eliminates the https://www.google.com/search?q=graphql+n%2B1[N+1 Problem], which can make GraphQL implementations slow and inefficient.

The Neo4j GraphQL Library features:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not able to comment on the section I want here 😬

This is just a minor point but in the features list filtering, sorting and pagination all belong in the same bullet point

In the xref::getting-started/index.adoc[Getting Started] guide, Apollo Server is used to host the GraphQL schema, so you can interact directly with your API with no frontend.
// Modify link below and add info about aura graphql

In xref::getting-started/graphql-aura.adoc[] as well as xref::getting-started/graphql-self-hosted.adoc[], Apollo Server is used to host the GraphQL schema, so you can interact directly with your API with no frontend.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't actually use yoga instead of Apollo Server in Aura. We also don't really want to be opinionated about which server self-hosted customers use as the library should work with any graphql server

Suggested change
In xref::getting-started/graphql-aura.adoc[] as well as xref::getting-started/graphql-self-hosted.adoc[], Apollo Server is used to host the GraphQL schema, so you can interact directly with your API with no frontend.
In xref::getting-started/graphql-aura.adoc[] as well as xref::getting-started/graphql-self-hosted.adoc[], a GraphQL server is used to serve the GraphQL schema, so you can interact directly with your API with no frontend.

In case you prefer to use frontend frameworks, these are some clients that interact with GraphQL APIs:

- https://reactjs.org/[React] - support through https://www.apollographql.com/docs/react/[Apollo Client]
- https://vuejs.org/[Vue.js] - support through https://apollo.vuejs.org/[Vue Apollo]
- https://angularjs.org/[AngularJS] - support through https://apollo-angular.com/docs/[Apollo Angular].


== Deployment

There are a variety of methods for deploying GraphQL APIs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to mention something here about using Aura to deploy your API as that would be our preference

Comment on lines +74 to +75
. https://neo4j.com/product/auradb/[Neo4j AuraDB] version 5.x with APOC core plugin or https://neo4j.com/deployment-center/#gdb-selfmanaged[Neo4j Database].
Note that version 5.15 or higher is required to use the xref:/directives/indexes-and-constraints.adoc#_vector_index_search[`@vector` directive].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were actually discussing last week changing this wording as it's inaccurate. We require users to be on the latest patch of a major version. There's also not much reason they shouldn't be keeping up to date

Also Aura always ships with APOC and there is no 5.x dbs in Aura anymore

Suggested change
. https://neo4j.com/product/auradb/[Neo4j AuraDB] version 5.x with APOC core plugin or https://neo4j.com/deployment-center/#gdb-selfmanaged[Neo4j Database].
Note that version 5.15 or higher is required to use the xref:/directives/indexes-and-constraints.adoc#_vector_index_search[`@vector` directive].
. https://neo4j.com/product/auradb/[Neo4j AuraDB] version 2025.x or https://neo4j.com/deployment-center/#gdb-selfmanaged[Neo4j Database] running the latest 5.x version or above with the APOC core plugin.


=== Via Apollo Server

. On the https://studio.apollographql.com/[Apollo Studio] website, paste your GraphQL Data API URL to the **Sandbox** input.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you go directly to https://studio.apollographql.com/sandbox/explorer you don't need to create an account or sign in

Suggested change
. On the https://studio.apollographql.com/[Apollo Studio] website, paste your GraphQL Data API URL to the **Sandbox** input.
. On the https://studio.apollographql.com/sandbox/explorer[Apollo Studio] website, paste your GraphQL Data API URL to the **Sandbox** input.

== Prerequisites

- The tutorial assumes familiarity with the command line and JavaScript.
- Make sure that you have a recent version of Node.js installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to be specific here. We require nodejs 20 or higher

Suggested change
- Make sure that you have a recent version of Node.js installed.
- Make sure that you have https://nodejs.org/en/[Node.js] 20+ installed.


[source, javascript, indent=0]
----
const driver = neo4j.driver(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I love that we're hardcoding the credentials here without a note that it's not best practice (anyone with access to your source code now has access to your DB).

Either we just add a warning/note about this risk or we should try to use environment variables e.g.

const {
    NEO4J_URI = "neo4j://localhost:7687/neo4j",
    NEO4J_USERNAME = "neo4j",
    NEO4J_PASSWORD = "password",
} = process.env;

const driver = neo4j.driver(
    NEO4J_URI,
    neo4j.auth.basic(NEO4J_USERNAME, NEO4J_PASSWORD)
);

With this example it's still possible to hardcode to get going quickly but we should prompt the user to not commit real creds and set them using environment variables going forward

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you have any thoughts on this or better ideas @mjfwebb?


To learn more, keep reading the documentation about xref:queries-aggregations/index.adoc[Queries and aggregations] or alternatively learn how to use the xref:getting-started/toolbox.adoc[Neo4j GraphQL Toolbox].
For more advanced database settings, refer to the xref:driver-configuration.adoc[Driver configuration] page.
These pages walks you through creating a new project with the Neo4j GraphQL Library.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These guides are both based on the northwind dataset right?

Is it worth mentioning here or maybe at the end of the guides that as a next step users could try loading that dataset into their db and extending the schema for the full data set to see what that adds to their api?

Ideally we could also write a guide for this in the future too!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i had added a reference to the northwind dataset initially, but the examples work without it so far (or rather, only work when no other data is present). the idea was to go in that direction and make it the default data set for all examples

i'd say, we leave it out for now, and revisit when the picture is more coherent. maybe we could add a page that is specifically about importing and then making the northwind set available to a client via the api

+
Set your type definitions directly in the Toolbox editor or introspect the Neo4j database you connected to.

If you followed the xref:getting-started/graphql-self-hosted.adoc[self-hosted GraphQL tutorial], use **Introspect** to see these type definitions in the GraphQL Toolbox:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth bearing in mind that if the user has done extra things in their db since that tutorial, they will likely see different type definitions when they introspect the db

@@ -334,6 +334,11 @@ type Movie @limit(max: 100, default: 10) @node {

== `@customResolver`

[NOTE]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

It's worth noting that there's a few other directives that are not supported currently.

The list is @populatedBy, @customResolvers, @subscriptions, @subscriptionsAuthorization&@vector`

Ideally we should add support for the last 3 soon though!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, good to know -
i added this note because John added it to the aura docs and i thought it's important enough to add to the directive itself. will add to the others 👍

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 this pull request may close these issues.

4 participants