Skip to content
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

Increase graphdb.js test coverage using sample data #53

Merged
merged 5 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions src/test/airports-neptune-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"nodeStructures": [
{
"label": "continent",
"properties": [
{
"name": "type",
"type": "String"
},
{
"name": "code",
"type": "String"
},
{
"name": "desc",
"type": "String"
}
]
},
{
"label": "country",
"properties": [
{
"name": "type",
"type": "String"
},
{
"name": "code",
"type": "String"
},
{
"name": "desc",
"type": "String"
}
]
},
{
"label": "version",
"properties": [
{
"name": "date",
"type": "String"
},
{
"name": "desc",
"type": "String"
},
{
"name": "author",
"type": "String"
},
{
"name": "type",
"type": "String"
},
{
"name": "code",
"type": "String"
}
]
},
{
"label": "airport",
"properties": [
{
"name": "type",
"type": "String"
},
{
"name": "city",
"type": "String"
},
{
"name": "icao",
"type": "String"
},
{
"name": "code",
"type": "String"
},
{
"name": "country",
"type": "String"
},
{
"name": "lat",
"type": "Float"
},
{
"name": "longest",
"type": "Float"
},
{
"name": "runways",
"type": "Float"
},
{
"name": "desc",
"type": "String"
},
{
"name": "lon",
"type": "Float"
},
{
"name": "region",
"type": "String"
},
{
"name": "elev",
"type": "Float"
}
]
}
],
"edgeStructures": [
{
"label": "contains",
"properties": [],
"directions": [
{
"from": "continent",
"to": "airport",
"relationship": "ONE-MANY"
},
{
"from": "country",
"to": "airport",
"relationship": "ONE-MANY"
}
]
},
{
"label": "route",
"properties": [
{
"name": "dist",
"type": "Float"
}
],
"directions": [
{
"from": "airport",
"to": "airport",
"relationship": "MANY-MANY"
}
]
}
]
}
119 changes: 119 additions & 0 deletions src/test/airports.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
type Continent @alias(property:"continent") {
_id: ID! @id
type: String
code: String
desc: String
airportContainssOut(filter: AirportInput, options: Options): [Airport] @relationship(edgeType:"contains", direction:OUT)
contains:Contains
}

input ContinentInput {
_id: ID @id
type: String
code: String
desc: String
}

type Country @alias(property:"country") {
_id: ID! @id
type: String
code: String
desc: String
airportContainssOut(filter: AirportInput, options: Options): [Airport] @relationship(edgeType:"contains", direction:OUT)
contains:Contains
}

input CountryInput {
_id: ID @id
type: String
code: String
desc: String
}

type Version @alias(property:"version") {
_id: ID! @id
date: String
desc: String
author: String
type: String
code: String
}

input VersionInput {
_id: ID @id
date: String
desc: String
author: String
type: String
code: String
}

type Airport @alias(property:"airport") {
_id: ID! @id
type: String
city: String
icao: String
code: String
country: String
lat: Float
longest: Float
runways: Float
desc: String
lon: Float
region: String
elev: Float
continentContainsIn: Continent @relationship(edgeType:"contains", direction:IN)
countryContainsIn: Country @relationship(edgeType:"contains", direction:IN)
airportRoutesOut(filter: AirportInput, options: Options): [Airport] @relationship(edgeType:"route", direction:OUT)
airportRoutesIn(filter: AirportInput, options: Options): [Airport] @relationship(edgeType:"route", direction:IN)
contains:Contains
route:Route
}

input AirportInput {
_id: ID @id
type: String
city: String
icao: String
code: String
country: String
lat: Float
longest: Float
runways: Float
desc: String
lon: Float
region: String
elev: Float
}

type Contains @alias(property:"contains") {
_id: ID! @id
}

type Route @alias(property:"route") {
_id: ID! @id
dist: Float
}

input RouteInput {
dist: Float
}

input Options {
limit:Int
}

type Query {
getNodeContinent(filter: ContinentInput): Continent
getNodeContinents(filter: ContinentInput, options: Options): [Continent]
getNodeCountry(filter: CountryInput): Country
getNodeCountrys(filter: CountryInput, options: Options): [Country]
getNodeVersion(filter: VersionInput): Version
getNodeVersions(filter: VersionInput, options: Options): [Version]
getNodeAirport(filter: AirportInput): Airport
getNodeAirports(filter: AirportInput, options: Options): [Airport]
}

schema {
query: Query
}
Loading
Loading