title: SWR with graphql-request how to add variables in swr?
body: <p>I want to add variables to my swr which fetch using graphql request. this is my code</p>
  <pre><code>import { request } from &quot;graphql-request&quot;;
  import useSWR from &quot;swr&quot;;
  
  const fetcher = (query, variables) =&gt; request(`https://graphql-pokemon.now.sh`, query, variables);
  
  export default function Example() {
    const variables = { code: 14 };
    const { data, error } = useSWR(
      `query GET_DATA($code: String!) {
                  getRegionsByCode(code: $code) {
                    code
                    name
                  }
                }`,
      fetcher
    );
  
    if (error) return &lt;div&gt;failed to load&lt;/div&gt;;
    if (!data) return &lt;div&gt;loading...&lt;/div&gt;;
    return &lt;pre&gt;{JSON.stringify(data, null, 2)}&lt;/pre&gt;;
  }
  </code></pre>
  <p>but I dont know how to add <code>variables</code> into swr fetcher as I know <code>useSWR(String, fetcher)</code> string is for query, and fetcher for fetch function, where I can put the variables?</p>