I am using R/Shiny with Apollo and the Neo4j GraphQL Library. I am inferring my schema using this:
const inferAugmentedSchema = driver => {
return inferSchema(driver).then(result => {
console.log(result.typeDefs)
return makeAugmentedSchema({
typeDefs: result.typeDefs
});
});
};
The schema point of interest is:
type Skill {
_id: Long!
name: String!
projects_in_need_of: [Project] @relation(name: "IN_NEED_OF", direction: IN)
}
type Project {
_id: Long!
description: String
name: String!
}
My query is:
execute_query = function(query) {
result <- conn$exec(Query$new()$query('link', query)$link)
flat_result <- result %>% fromJSON(flatten = F)
print(flat_result)
result.df <- as.data.frame(flat_result[[1]])
print(result.df)
output$table <- DT::renderDataTable({result.df}, rownames = TRUE, filter = 'top', selection = 'single', extensions = 'Buttons')
}
# Run a query
execute_query('
query SampleQuery {
Skill{
name
projects_in_need_of{
name
description
}
}
}
')
The code will return the name of the skill, then it will return skill.projects_in_need_of instead of the name, and description. When it has a project to return, it returns [object Object]
I can't figure out if it is my query or not- I am new to this and using a template!