-1

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}
`;
Aslı
  • 105
  • 1
  • 1
  • 9

1 Answers1

0

Your question is not clear. Start by creating a github repo and pushing your code there. That way we can better help you.

Ben Tahar
  • 69
  • 4