From 4edb4761a1930aea9b6349ca37ee2518b1238093 Mon Sep 17 00:00:00 2001 From: Glen Date: Tue, 6 Aug 2024 10:44:15 +0200 Subject: [PATCH] Removed Neo4J docs (#7336) --- website/src/docs/docs.json | 4 - .../hotchocolate/v14/integrations/index.md | 6 - .../hotchocolate/v14/integrations/neo4j.md | 192 ------------------ 3 files changed, 202 deletions(-) delete mode 100644 website/src/docs/hotchocolate/v14/integrations/neo4j.md diff --git a/website/src/docs/docs.json b/website/src/docs/docs.json index eaee925bcc9..d40368434f0 100644 --- a/website/src/docs/docs.json +++ b/website/src/docs/docs.json @@ -277,10 +277,6 @@ "path": "mongodb", "title": "MongoDB" }, - { - "path": "neo4j", - "title": "Neo4J" - }, { "path": "spatial-data", "title": "Spatial Data" diff --git a/website/src/docs/hotchocolate/v14/integrations/index.md b/website/src/docs/hotchocolate/v14/integrations/index.md index 6bfc56bb6d0..66485653817 100644 --- a/website/src/docs/hotchocolate/v14/integrations/index.md +++ b/website/src/docs/hotchocolate/v14/integrations/index.md @@ -16,12 +16,6 @@ You will learn how to access MongoDB from within your resolvers and how to trans [Learn more about our MongoDB integration](/docs/hotchocolate/v14/integrations/mongodb) -# Neo4J - -You will learn how to access Neo4J from within your resolvers and how to translate our pagination, projection, filtering and sorting capabilities to native Neo4J queries. - -[Learn more about our Neo4J integration](/docs/hotchocolate/v14/integrations/neo4j) - # Spatial Data You will learn how you can expose [NetTopologySuite types](https://github.com/NetTopologySuite/NetTopologySuite) in form of [GeoJSON](https://geojson.org/) and how to integrate it with our data APIs. diff --git a/website/src/docs/hotchocolate/v14/integrations/neo4j.md b/website/src/docs/hotchocolate/v14/integrations/neo4j.md deleted file mode 100644 index 77802c9bd33..00000000000 --- a/website/src/docs/hotchocolate/v14/integrations/neo4j.md +++ /dev/null @@ -1,192 +0,0 @@ ---- -title: Neo4J Database ---- - -HotChocolate has a data integration for Neo4J. -With this integration, you can translate paging, filtering, sorting, and projections, directly into native cypher queries. - -You can find a example project in [HotChocolate Examples](https://github.com/ChilliCream/graphql-workshop-neo4j) - -# Get Started - -To use the Neo4J integration, you need to install the package `HotChocolate.Data.Neo4J`. - - - -# Neo4JExecutable - -The whole integration builds around `IExecutable`. -The execution engine picks up the `IExecutable` and executes it efficiently. - -```csharp -[UseNeo4JDatabase("neo4j")] -[UsePaging] -[UseProjection] -[UseSorting] -[UseFiltering] -public IExecutable GetPersons([ScopedService] IAsyncSession session) => - new Neo4JExecutable(session); -``` - -# Filtering - -To use Neo4J filtering you need to register the convention on the schema builder: - -```csharp -services - .AddGraphQLServer() - .AddQueryType() - .AddNeo4JFiltering(); -``` - -> To use Neo4J filtering alongside with `IQueryable`/`IEnumerable`, you have to register the Neo4J convention under a different scope. -> You can specify the scope on the schema builder by executing `AddNeo4JFiltering("yourScope")`. -> You then have to specify this scope on each method you use Neo4J filtering: `[UseFiltering(Scope = "yourScope")]` or `UseFiltering(scope = "yourScope")` - -Your filters are now converted to cypher and applied to the executable. - -_GraphQL Query:_ - -```graphql -query GetPersons { - persons(where: { name: { eq: "Yorker Shorton" } }) { - name - addresses { - street - city - } - } -} -``` - -_Cypher Query_ - -```cypher -MATCH (person:Person) -WHERE person.name = 'Yorker Shorton" -RETURN person {.name} -``` - -# Sorting - -To use Neo4J sorting you need to register the convention on the schema builder: - -```csharp -services - .AddGraphQLServer() - .AddQueryType() - .AddNeo4JSorting(); -``` - -> To use Neo4J Sorting alongside with `IQueryable`/`IEnumerable`, you have to register the Neo4J convention under a different scope. -> You can specify the scope on the schema builder by executing `AddNeo4JSorting("yourScope")`. -> You then have to specify this scope on each method you use Neo4J Sorting: `[UseSorting(Scope = "yourScope")]` or `UseSorting(scope = "yourScope")` - -Your sorting is now converted to cypher and applied to the executable. - -_GraphQL Query:_ - -```graphql -query GetPersons { - persons(order: [{ name: ASC }]) { - name - addresses { - street - city - } - } -} -``` - -_Cypher Query_ - -```cypher -MATCH (person:Person) -WHERE person.name = 'Yorker Shorton" AND -RETURN person {.name} -``` - -# Projections - -To use Neo4J projections you need to register the convention on the schema builder: - -```csharp -services - .AddGraphQLServer() - .AddQueryType() - .AddNeo4JProjections(); -``` - -> To use Neo4J Projections alongside with `IQueryable`/`IEnumerable`, you have to register the Neo4J convention under a different scope. -> You can specify the scope on the schema builder by executing `AddNeo4JProjections("yourScope")`. -> You then have to specify this scope on each method you use Neo4J Projections: `[UseProjections(Scope = "yourScope")]` or `UseProjections(scope = "yourScope")` - -_GraphQL Query:_ - -```graphql -query GetPersons { - persons { - name - addresses { - city - } - } -} -``` - -_Cypher Query_ - -```cypher -MATCH (person:Person) -WHERE person.name = 'Yorker Shorton" AND -RETURN person {.name} -``` - -# Paging - -In order to use pagination with Neo4J, we have to register the Neo4J specific pagination providers. - -```csharp -services - .AddGraphQLServer() - .AddNeo4JPagingProviders(); -``` - -[Learn more about pagination providers](/docs/hotchocolate/v14/fetching-data/pagination#providers) - -## Cursor Pagination - -Not Implemented! - -## Offset Pagination - -To use offset based pagination annotate your resolver with `[UseOffsetPaging]` or `.UseNeo4JPaging()` - -```csharp -[UseNeo4JDatabase("neo4j")] -[UseOffsetPaging] -[UseProjection] -public IExecutable GetPersons([ScopedService] IAsyncSession session) => - new Neo4JExecutable(session); -``` - -You can then execute queries like the following one: - -```graphql -query GetPersons { - persons(skip: 50, take: 50) { - items { - name - addresses { - city - } - } - pageInfo { - hasNextPage - hasPreviousPage - } - } -} -``` - -