Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
🎨➕ Improve code syntax with gql where applicable. Add .env file readi…
Browse files Browse the repository at this point in the history
…ng feature to script.
  • Loading branch information
Daniel Kaminski de Souza committed Jan 26, 2021
1 parent 53733c5 commit 041574e
Show file tree
Hide file tree
Showing 8 changed files with 288 additions and 238 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,10 @@ neo4j-version
test/tck/*
!test/tck/.gitkeep

.history
.history

__MACOSX
neo4j

neo4j-enterprise*
recommendations.db.zip*
11 changes: 6 additions & 5 deletions example/apollo-server/authScopes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { gql } from 'apollo-server';
import { makeAugmentedSchema } from '../../src/index';
import { ApolloServer } from 'apollo-server';
import neo4j from 'neo4j-driver';
Expand All @@ -11,15 +12,15 @@ import neo4j from 'neo4j-driver';
// JWT_SECRET
// oqldBPU1yMXcrTwcha1a9PGi9RHlPVzQ

const typeDefs = `
type User {
const typeDefs = gql`
type User {
userId: ID!
name: String
}
}
type Business {
type Business {
name: String
}
}
`;

const schema = makeAugmentedSchema({
Expand Down
74 changes: 37 additions & 37 deletions example/apollo-server/bookmarks.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import { gql } from 'apollo-server';
import { makeAugmentedSchema } from '../../src/index';
import { ApolloServer } from 'apollo-server';
import neo4j from 'neo4j-driver';

const typeDefs = `
type Person {
_id: Long!
born: Int
name: String!
acted_in: [Movie] @relation(name: "ACTED_IN", direction: "OUT")
ACTED_IN_rel: [ACTED_IN]
directed: [Movie] @relation(name: "DIRECTED", direction: "OUT")
produced: [Movie] @relation(name: "PRODUCED", direction: "OUT")
wrote: [Movie] @relation(name: "WROTE", direction: "OUT")
follows: [Person] @relation(name: "FOLLOWS", direction: "OUT")
reviewed: [Movie] @relation(name: "REVIEWED", direction: "OUT")
REVIEWED_rel: [REVIEWED]
}
type Movie {
_id: Long!
released: Int!
tagline: String
title: String!
persons_acted_in: [Person] @relation(name: "ACTED_IN", direction: "IN")
persons_directed: [Person] @relation(name: "DIRECTED", direction: "IN")
persons_produced: [Person] @relation(name: "PRODUCED", direction: "IN")
persons_wrote: [Person] @relation(name: "WROTE", direction: "IN")
persons_reviewed: [Person] @relation(name: "REVIEWED", direction: "IN")
}
const typeDefs = gql`
type Person {
_id: Long!
born: Int
name: String!
acted_in: [Movie] @relation(name: "ACTED_IN", direction: "OUT")
ACTED_IN_rel: [ACTED_IN]
directed: [Movie] @relation(name: "DIRECTED", direction: "OUT")
produced: [Movie] @relation(name: "PRODUCED", direction: "OUT")
wrote: [Movie] @relation(name: "WROTE", direction: "OUT")
follows: [Person] @relation(name: "FOLLOWS", direction: "OUT")
reviewed: [Movie] @relation(name: "REVIEWED", direction: "OUT")
REVIEWED_rel: [REVIEWED]
}
type ACTED_IN @relation(name: "ACTED_IN") {
from: Person!
to: Movie!
roles: [String]!
}
type Movie {
_id: Long!
released: Int!
tagline: String
title: String!
persons_acted_in: [Person] @relation(name: "ACTED_IN", direction: "IN")
persons_directed: [Person] @relation(name: "DIRECTED", direction: "IN")
persons_produced: [Person] @relation(name: "PRODUCED", direction: "IN")
persons_wrote: [Person] @relation(name: "WROTE", direction: "IN")
persons_reviewed: [Person] @relation(name: "REVIEWED", direction: "IN")
}
type REVIEWED @relation(name: "REVIEWED") {
from: Person!
to: Movie!
rating: Int!
summary: String!
}
type ACTED_IN @relation(name: "ACTED_IN") {
from: Person!
to: Movie!
roles: [String]!
}
type REVIEWED @relation(name: "REVIEWED") {
from: Person!
to: Movie!
rating: Int!
summary: String!
}
`;

const schema = makeAugmentedSchema({ typeDefs });
Expand Down
32 changes: 18 additions & 14 deletions example/apollo-server/interface-union-example.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
import { gql } from 'apollo-server';
import { makeAugmentedSchema } from '../../src/index';
const { ApolloServer } = require('apollo-server');
const neo4j = require('neo4j-driver');

const __unionTypeDefs = `
union SearchResult = Blog | Movie
const __unionTypeDefs = gql`
union SearchResult = Blog | Movie
type Blog {
blogId: ID!
created: DateTime
content: String
}
type Blog {
blogId: ID!
created: DateTime
content: String
}
type Movie {
movieId: ID!
title: String
}
type Movie {
movieId: ID!
title: String
}
type Query {
search(searchString: String!): [SearchResult] @cypher(statement:"CALL db.index.fulltext.queryNodes('searchIndex', $searchString) YIELD node RETURN node")
}
type Query {
search(searchString: String!): [SearchResult]
@cypher(
statement: "CALL db.index.fulltext.queryNodes('searchIndex', $searchString) YIELD node RETURN node"
)
}
`;

const __interfaceTypeDefs = `
Expand Down
Loading

0 comments on commit 041574e

Please sign in to comment.