Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(server): graphql schema (#446)
- Loading branch information
1 parent
f27b788
commit ee07100
Showing
18 changed files
with
4,343 additions
and
4,068 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
scalar Upload | ||
scalar Any | ||
scalar DateTime | ||
scalar URL | ||
scalar Lang | ||
scalar FileSize | ||
scalar TranslatedString | ||
scalar Cursor | ||
|
||
# Meta Type | ||
|
||
interface Node { | ||
id: ID! | ||
} | ||
|
||
enum NodeType { | ||
ASSET | ||
USER | ||
TEAM | ||
PROJECT | ||
PLUGIN | ||
SCENE | ||
PROPERTY_SCHEMA | ||
PROPERTY | ||
DATASET_SCHEMA | ||
DATASET | ||
LAYER_GROUP | ||
LAYER_ITEM | ||
} | ||
|
||
# Pagination | ||
|
||
type PageInfo { | ||
startCursor: Cursor | ||
endCursor: Cursor | ||
hasNextPage: Boolean! | ||
hasPreviousPage: Boolean! | ||
} | ||
|
||
input Pagination{ | ||
first: Int | ||
last: Int | ||
after: Cursor | ||
before: Cursor | ||
} | ||
|
||
# Basic types | ||
|
||
type LatLng { | ||
lat: Float! | ||
lng: Float! | ||
} | ||
|
||
type LatLngHeight { | ||
lat: Float! | ||
lng: Float! | ||
height: Float! | ||
} | ||
|
||
type Camera { | ||
lat: Float! | ||
lng: Float! | ||
altitude: Float! | ||
heading: Float! | ||
pitch: Float! | ||
roll: Float! | ||
fov: Float! | ||
} | ||
|
||
type Rect { | ||
west: Float! | ||
south: Float! | ||
east: Float! | ||
north: Float! | ||
} | ||
|
||
type Typography { | ||
fontFamily: String | ||
fontWeight: String | ||
fontSize: Int | ||
color: String | ||
textAlign: TextAlign | ||
bold: Boolean | ||
italic: Boolean | ||
underline: Boolean | ||
} | ||
|
||
enum TextAlign { | ||
LEFT | ||
CENTER | ||
RIGHT | ||
JUSTIFY | ||
JUSTIFY_ALL | ||
} | ||
|
||
# Query & Mutation | ||
|
||
type Query { | ||
node(id: ID!, type: NodeType!): Node | ||
nodes(id: [ID!]!, type: NodeType!): [Node]! | ||
} | ||
|
||
type Mutation | ||
|
||
schema { | ||
query: Query | ||
mutation: Mutation | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
type Asset implements Node { | ||
id: ID! | ||
createdAt: DateTime! | ||
teamId: ID! | ||
name: String! | ||
size: FileSize! | ||
url: String! | ||
contentType: String! | ||
team: Team | ||
} | ||
|
||
enum AssetSortType { | ||
DATE | ||
SIZE | ||
NAME | ||
} | ||
|
||
# InputType | ||
|
||
input CreateAssetInput { | ||
teamId: ID! | ||
file: Upload! | ||
} | ||
|
||
input RemoveAssetInput { | ||
assetId: ID! | ||
} | ||
|
||
# Payload | ||
|
||
type CreateAssetPayload { | ||
asset: Asset! | ||
} | ||
|
||
type RemoveAssetPayload { | ||
assetId: ID! | ||
} | ||
|
||
# Connection | ||
|
||
type AssetConnection { | ||
edges: [AssetEdge!]! | ||
nodes: [Asset]! | ||
pageInfo: PageInfo! | ||
totalCount: Int! | ||
} | ||
|
||
type AssetEdge { | ||
cursor: Cursor! | ||
node: Asset | ||
} | ||
|
||
extend type Query{ | ||
assets(teamId: ID!, keyword: String, sort: AssetSortType, pagination: Pagination): AssetConnection! | ||
} | ||
|
||
extend type Mutation { | ||
createAsset(input: CreateAssetInput!): CreateAssetPayload | ||
removeAsset(input: RemoveAssetInput!): RemoveAssetPayload | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
type Cluster { | ||
id: ID! | ||
name: String! | ||
propertyId: ID! | ||
property: Property | ||
} | ||
|
||
# InputType | ||
|
||
input AddClusterInput { | ||
sceneId: ID! | ||
name: String! | ||
} | ||
|
||
input UpdateClusterInput { | ||
clusterId: ID! | ||
sceneId: ID! | ||
name: String | ||
propertyId: ID | ||
} | ||
|
||
input RemoveClusterInput { | ||
clusterId: ID! | ||
sceneId: ID! | ||
} | ||
|
||
# Payload | ||
|
||
type AddClusterPayload { | ||
scene: Scene! | ||
cluster: Cluster! | ||
} | ||
|
||
type UpdateClusterPayload { | ||
scene: Scene! | ||
cluster: Cluster! | ||
} | ||
|
||
type RemoveClusterPayload { | ||
scene: Scene! | ||
clusterId: ID! | ||
} | ||
|
||
#extend type Query{ } | ||
|
||
extend type Mutation { | ||
addCluster(input: AddClusterInput!): AddClusterPayload | ||
updateCluster(input: UpdateClusterInput!): UpdateClusterPayload | ||
removeCluster(input: RemoveClusterInput!): RemoveClusterPayload | ||
} |
Oops, something went wrong.