open-index/open-npm huggingface dataset:
npm package: @opencreek/neo4j-graphql-ogm
Description: GraphQL powered OGM for Neo4j and Javascript applications
Author: Neo4j Inc.
Latest version: 3.24.3-oc.2

# @neo4j/graphql-ogm

<p align="center">
  <a href="https://badge.fury.io/js/%40neo4j%2Fgraphql-ogm">
    <img alt="npm package" src="https://badge.fury.io/js/%40neo4j%2Fgraphql-ogm.svg">
  </a>
  <a href="https://discord.gg/neo4j">
    <img alt="Discord" src="https://img.shields.io/discord/787399249741479977?logo=discord&logoColor=white">
  </a>
  <a href="https://community.neo4j.com/c/drivers-stacks/graphql/33">
    <img alt="Discourse users" src="https://img.shields.io/discourse/users?logo=discourse&server=https%3A%2F%2Fcommunity.neo4j.com">
  </a>
</p>

GraphQL powered OGM for Neo4j and Javascript applications.

1. [Documentation](https://neo4j.com/docs/graphql-manual/current/ogm/)

## Installation

```
$ npm install @neo4j/graphql-ogm
```

⚠ `graphql` & `neo4j-driver` are **peerDependency**(s)

```
$ npm install graphql neo4j-driver
```

## Importing

Our TypeScript source is transpiled into Common JS, this means you can use the `require` syntax;

```js
const { OGM, Model } = require("@neo4j/graphql-ogm");
```

### Quick Start

```js
const { OGM } = require("@neo4j/graphql-ogm");
const neo4j = require("neo4j-driver");

const typeDefs = `
    type Movie {
        id: ID
        name: String
    }
`;

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

const ogm = new OGM({ typeDefs, driver });

async function main() {
    await ogm.init();

    const Movie = ogm.model("Movie");

    const [theMatrix] = await Movie.find({ where: { name: "The Matrix" } });
}
```

## Licence

[Apache 2.0](https://github.com/neo4j/graphql/blob/master/packages/ogm/LICENSE.txt)
npm package: @opencreek/neo4j-graphql-plugin-auth
Description: Auth decode plugins for @opencreek/neo4j-graphql
Author: Neo4j Inc.
Latest version: 2.2.0-oc.3

# @neo4j/graphql-plugin-auth

Auth decode plugins for @neo4j/graphql

1. [Documentation](https://neo4j.com/docs/graphql-manual/current/auth/)

## Installation

```
$ npm install @neo4j/graphql-plugin-auth
```

## Usage

### `Neo4jGraphQLAuthJWTPlugin`

```ts
import { Neo4jGraphQL } from "@neo4j/graphql";
import { Neo4jGraphQLAuthJWTPlugin } from "@neo4j/graphql-plugin-auth";

const neoSchema = new Neo4jGraphQL({
    typeDefs,
    plugins: {
        auth: new Neo4jGraphQLAuthJWTPlugin({
            secret: "super-secret",
        }),
    },
});

// Or you can initiate the secret with a function which will run to retrieve the secret when the request comes in

const neoSchema = new Neo4jGraphQL({
    typeDefs,
    plugins: {
        auth: new Neo4jGraphQLAuthJWTPlugin({
            secret: (req) => {
                return "super-secret";
            },
        }),
    },
});
```

### `Neo4jGraphQLAuthJWKSPlugin`

```ts
import { Neo4jGraphQL } from "@neo4j/graphql";
import { Neo4jGraphQLAuthJWKSPlugin } from "@neo4j/graphql-plugin-auth";

const neoSchema = new Neo4jGraphQL({
    typeDefs,
    plugins: {
        auth: new Neo4jGraphQLAuthJWKSPlugin({
            jwksEndpoint: "https://YOUR_DOMAIN/well-known/jwks.json",
        }),
    },
});

//Or you can pass a function as jskwsEndpoint to compute the endpoint when the request comes in.

const neoSchema = new Neo4jGraphQL({
    typeDefs,
    plugins: {
        auth: new Neo4jGraphQLAuthJWKSPlugin({
            jwksEndpoint: (req) => {
                let url = "https://YOUR_DOMAIN/well-known/{file}.json";
                const fileHeader = req.headers["file"];
                url = url.replace("{file}", fileHeader);
                return url;
            },
        }),
    },
});
```

## Licence

[Apache 2.0](https://github.com/neo4j/graphql/blob/master/packages/graphql-plugin-auth/LICENSE.txt)