I am new in Graphql and React. I need help. I tried get query from user like GraphiQL. I want get query from user and return result. I made a query. If I write query, it works but otherwise I am getting error. My code block as below like and works :
My code block like and works :
let BLOCK_QUERY = gql`
query {
block {
id
type
}
}
`;
I try get query from user like this but is not work:
let BLOCK_QUERY = gql`
this.state.block
`;
Maybe I think I will do things close to that.
let BLOCK_QUERY = gql`
${this.state.block}
`;