Skip to content

Editorial fixes - #322

Merged
rsill-neo4j merged 7 commits into
7.xfrom
reading-and-fixing
Sep 4, 2026
Merged

rsill-neo4j merged 7 commits into
7.xfrom
reading-and-fixing

Conversation

@rsill-neo4j

Copy link
Copy Markdown
Contributor

No description provided.

@rsill-neo4j
rsill-neo4j marked this pull request as ready for review August 27, 2026 12:54
@rsill-neo4j

Copy link
Copy Markdown
Contributor Author

tagged @a-alle for the relationship suggestions because it was your PR when it was added and @Liam-Doodson for the rest. feel free to forward

Comment thread modules/ROOT/pages/relationships/single-relationships.adoc Outdated
Comment thread modules/ROOT/pages/relationships/unions.adoc Outdated

An example of configuring user switching on a per request basis can be found in the example below. Note that the username and password are provided in HTTP headers `User` and `Password`, but this would not be recommended for production use:
The example below showcases the configuration of user switching on a per request basis.
Note that the username and password are provided via the HTTP headers `User` and `Password`.

@keremgocen keremgocen Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we just use different examples if this is not recommended in prod? (We might have the same issue in MCP actually but that's for a different PR:))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

what would be the standard way of providing username + password under production use circumstances, and would this make the example considerably longer?

i absolutely see the point - if we can provide an example without the "asterisk" (don't use this in prod!), that would be great. maybe it was written this way with conciseness considerations in mind?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We'd need to verify it works but using bearer auth with an oidc provider configured for the db would be more secure. i.e. something like this:

import { ApolloServer } from "@apollo/server";
import { startStandaloneServer } from "@apollo/server/standalone";
import { Neo4jGraphQL, Neo4jGraphQLContext } from "@neo4j/graphql";
import neo4j from "neo4j-driver";

const typeDefs = `#graphql
    type Movie @node {
        title: String!
    }
`;

const driver = neo4j.driver(
    "neo4j://localhost:7687",
    neo4j.auth.basic("username", "password")
);

const neo4jGraphql = new Neo4jGraphQL({
    typeDefs,
    driver,
});

const schema = await neo4jGraphql.getSchema();

const server = new ApolloServer<Neo4jGraphQLContext>({
  schema,
});

const { url } = await startStandaloneServer(server, {
  context: async ({ req }) => {
    const authHeader = req.headers.authorization ?? "";
    const [scheme, token] = authHeader.split(" ");

    if (scheme !== "Bearer" || !token) {
      throw new Error("Missing or malformed Bearer token");
    }

    return {
      sessionConfig: {
        auth: neo4j.auth.bearer(token),
      },
    };
  },
});

console.log(`🚀  Server ready at: ${url}`);

We'd probably have to check that snippet actually works and clarify that the bearer token needs to be signed by an oidc provider configured for the db

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This could probably be done in a follow-up PR though tbh as it requires a bit more correctness checking than the rest of these changes

Co-authored-by: kerem <kerem.gocen@neo4j.com>
Comment thread modules/ROOT/pages/relationships/operations.adoc Outdated
Co-authored-by: Liam-Doodson <114480811+Liam-Doodson@users.noreply.github.com>
@neo4j-docops-agent

neo4j-docops-agent commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for the documentation updates.

The preview documentation has now been torn down - reopening this PR will republish it.

@rsill-neo4j
rsill-neo4j merged commit b72f9e2 into 7.x Sep 4, 2026
5 checks passed
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