Built with Node.JS, Express and the express-graphql package.
- Firstly clone this repo locally
- Run
npm install
to install the project dependencies - Run
node index.js
ornodemon index.js
to start the application
You should then be able to access the GraphiQL UI by visting http://localhost:4004/graphql
Full documentation is generated by the GraphiQL UI which can be accessed by visting http://localhost:4000/graphql
query {
questions {
q_id
question
points_type
possibleAnswers{
scale_id
label
points
}
}
}
{
"data": {
"questions": [
{
"q_id": 1,
"question": "I have felt tense, anxious or nervous",
"points_type": 123,
"possibleAnswers": [
{
"scale_id": 10,
"label": "Not all all",
"points": 0
},
{
"scale_id": 20,
"label": "Only occasionally",
"points": 1
},
{
"scale_id": 30,
"label": "Sometimes",
"points": 2
}
]
},
{
"q_id": 2,
"question": " I have felt I have someone to turn to for support when needed",
"points_type": 321,
"possibleAnswers": [
{
"scale_id": 10,
"label": "Not all all",
"points": 4
},
{
"scale_id": 20,
"label": "Only occasionally",
"points": 3
},
{
"scale_id": 30,
"label": "Sometimes",
"points": 2
}
]
}
]
}
}
type CoreQuestion {
q_id: Int
question: String
gp_order: Int
points_type: Int
points_id: Int
possibleAnswers: [AnswerLabel]
}
type AnswerLabel {
scale_id: Int
label: String
points: Int
}