我有一个带有 GraphQL 查询的字符串变量。我想编写一个函数来返回这个 gql 标签。能不能帮我写一下。例如:
输入:
let input = `query { employee { id surname } }`;
输出:
let output = gql`query { employee { id surname } }`;
const getTagFromString = (input) => { ????? };
let output = getTagFromString(input);
useQuery(output);