{
smartDocTreeConfig {
contextMenuConfig {
sections {
section {
sectionType(value: "descriptionItem")
menus {
menu {
menuId
actions {
action {
operation
value
}
}
}
}
}
}
}
}
}
Community ,
We have been trying to write a dynamic GraphQL query :
Here, each record can have either a list of subheader or list of breadcrumbs
In an Angular Client,
when we subscribe to the valueChanges() of the graphql.watchQuery(), it returns an immediate(after a second) response stating the following
{
data: undefined
loading: false
networkStatus: 7
stale: true
}
The data from the server is not fetched yet.
Now, when the data is received successfully it does not invoke the valueChanges() but the response is available when we check the network tab.
How do we resolve this issue.
Query:
gql`
query node{
node(uuid: "b46250296ca049a5a250296ca029a57b", lang: ["en"]) {
children(filter: {schema: {is: section}}) {
elements {
uuid
fields {
... on section {
title
description
index
hasSeperator
callToActionLabel
showOnlyWidgetInfo
widgetsDetail {
... on subheader {
chooseLanguageLabel
hasLanguageDropdown
loginLabel
loginRoute
registrationLabel
registrationRoute
}
... on breadcrumb {
name
routePath
index
}
}
}
}
}
}
}
}
I would like to export Schema - I am reading this doc: https://docs.graphcms.com/developers/api/import-export#exporting
But I don't understand how to use System Token. Please help!
JSONField
JSONField
example. I would like to filter, search
on it. Is that possible?
Can anyone point me to a reference implementation of nested / namespaced Mutations?
mutation {
Diagnostics {
doSomeAction(input:3){
success
message
}
}
}
Presently have single level working just fine (i.e. no Diagnostics
in the object above). I can define the schema just fine however run into problems with the sub-mutation actually being resolved.
const express = require("express");
const { gql, ApolloServer } = require("apollo-server-express");
const heroes = [
{ id: 1000, name: "bunny" },
{ id: 2000, name: "ram" }
];
const typeDefs = gql`
type Query {
heroes: [Hero]
getHero(id: Int): Hero
}
type Hero {
id: Int
name: String
}
`;
const resolvers = {
Query: {
heroes: () => heroes,
getHero: (_, args, context) => heroes.find(e => e === args.id)
}
};
const server = new ApolloServer({ typeDefs, resolvers });
const app = express();
server.applyMiddleware({ app });
app.listen({ port: 4000 }, () =>
console.log("http://localhost:4000" + server.graphqlPath)
);
getHero: (_, args, context) => heroes.find(e => e === args.id)
{
getHero(id:1000){
id
name
}
}