Skip to content
Snippets Groups Projects
Commit a408a35c authored by Philippe Bordron's avatar Philippe Bordron
Browse files

feat: add Guide.subclass_label

parent 3e470bab
No related branches found
No related tags found
1 merge request!5New api nomenclature
......@@ -6,6 +6,7 @@ import cors from 'cors';
import { Neo4jGraphQL } from "@neo4j/graphql";
import neo4j from "neo4j-driver";
import typeDefs from './schema.js';
import resolvers from './resolvers.js';
// Required logic for integrating with Express
const app = express();
......@@ -31,6 +32,7 @@ const driver = neo4j.driver(
const neoSchema = new Neo4jGraphQL({
typeDefs,
resolvers,
driver,
debug: DEBUG
});
......
import { resolvers as guideClassLabelResolver } from './resolvers/guide_class_label.js'
const resolvers = [
guideClassLabelResolver
]
export default resolvers
\ No newline at end of file
const guideClassLabel = {
'CD': 'CD Box SnoRNA',
'HACA': 'H/ACA Box SnoRNA',
'ScaRNA': 'ScaRNA',
'Other': 'Other Guide'
}
export const resolvers = {
Guide: {
subclass_label(source) {return guideClassLabel[source.subclass] ?? source.subclass}
}
}
\ No newline at end of file
......@@ -35,6 +35,9 @@ type Guide implements Sequence @node(labels: ["Sequence", "Guide"]) {
"""The subclass of the guide (CD Box, H/ACA Box, ScaRNA)"""
subclass: GuideClass!
"""The subclass of the guide (CD Box, H/ACA Box, ScaRNA)"""
subclass_label: String! @customResolver(requires: "subclass")
"""The Sequence Ontology (so) id"""
so_id: String @default(value: "SO_0000673")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment