File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/app/src/cli/services/dev/graphiql Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import {adminUrl, supportedApiVersions} from '@shopify/cli-kit/node/api/admin'
99import { fetch } from '@shopify/cli-kit/node/http'
1010import { renderLiquidTemplate } from '@shopify/cli-kit/node/liquid'
1111import { outputDebug } from '@shopify/cli-kit/node/output'
12- import { encode as queryStringEncode } from 'node:querystring'
1312import { Server } from 'http'
1413import { Writable } from 'stream'
1514import { createRequire } from 'module'
@@ -75,17 +74,19 @@ export function setupGraphiQLServer({
7574 try {
7675 outputDebug ( 'refreshing token' , stdout )
7776 _token = undefined
78- const queryString = queryStringEncode ( {
77+ const bodyData = {
7978 client_id : apiKey ,
8079 client_secret : apiSecret ,
8180 grant_type : 'client_credentials' ,
82- } )
83- const tokenResponse = await fetch ( `https://${ storeFqdn } /admin/oauth/access_token? ${ queryString } ` , {
81+ }
82+ const tokenResponse = await fetch ( `https://${ storeFqdn } /admin/oauth/access_token` , {
8483 method : 'POST' ,
8584 headers : {
8685 'Content-Type' : 'application/json' ,
8786 } ,
87+ body : JSON . stringify ( bodyData ) ,
8888 } )
89+
8990 const tokenJson = ( await tokenResponse . json ( ) ) as { access_token : string }
9091 return tokenJson . access_token
9192 } catch ( _error ) {
You can’t perform that action at this time.
0 commit comments