Skip to content
Snippets Groups Projects
Commit d65044fc authored by Steve Reis's avatar Steve Reis
Browse files

Merge branch...

Merge branch '15-as-a-developer-i-want-to-design-the-metadata-schema-in-order-to-implement-the-api' into 'develop'

Resolve "As a developer I want to design the metadata schema in order to implement the API"

Closes #15

See merge request sibmip/gateway!4
parents e78f75dd d35c44a2
No related branches found
No related tags found
No related merge requests found
......@@ -2,13 +2,23 @@ import { Inject } from '@nestjs/common';
import { Query, Resolver } from '@nestjs/graphql';
import { ENGINE_SERVICE } from './engine.constants';
import { IEngineService } from './engine.interfaces';
import { Domain } from './models/domain.model';
@Resolver()
export class EngineResolver {
constructor(@Inject(ENGINE_SERVICE) private readonly engineService: IEngineService) { }
@Query(() => String)
@Query(() => Domain)
async hello() {
return this.engineService.demo();
let dummy: Domain = {
id: "test",
label: "test",
description: "test",
groups: [],
variables: [],
datasets: []
}
return dummy;
}
}
\ No newline at end of file
import { Field, ObjectType } from "@nestjs/graphql";
@ObjectType()
export class Category {
@Field()
id: string
@Field()
label: string;
}
\ No newline at end of file
import { Field, ObjectType } from "@nestjs/graphql";
import { Category } from "./category.model";
import { Group } from "./group.model";
@ObjectType()
export class Domain extends Group {
@Field(type => [Category])
datasets: Category[];
}
\ No newline at end of file
import { Field, ObjectType } from "@nestjs/graphql";
import { Variable } from "./variable.model";
@ObjectType()
export class Group {
@Field()
id: string;
@Field()
label: string;
@Field({ nullable: true })
description?: string;
@Field(type => [Group])
groups: Group[];
@Field(type => [Variable])
variables: Variable[];
}
\ No newline at end of file
import { Field, ObjectType } from "@nestjs/graphql";
import { Category } from "./category.model";
import { Group } from "./group.model";
@ObjectType()
export class Variable {
@Field()
id: string;
@Field({ nullable: true })
label?: string;
@Field()
type: string;
@Field({ nullable: true })
description?: string;
@Field(type => [Category])
enumerations: Category[];
@Field(type => [Group])
groups: Group[];
}
\ No newline at end of file
......@@ -2,6 +2,37 @@
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
# ------------------------------------------------------
type Category {
id: String!
label: String!
}
type Variable {
id: String!
label: String
type: String!
description: String
enumerations: [Category!]!
groups: [Group!]!
}
type Group {
id: String!
label: String!
description: String
groups: [Group!]!
variables: [Variable!]!
}
type Domain {
id: String!
label: String!
description: String
groups: [Group!]!
variables: [Variable!]!
datasets: [Category!]!
}
type Query {
hello: String!
hello: Domain!
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment