Error in GraphQL: variable “$sessionId” of type “string” used in position expecting type “string!”.
1. Error in GraphQL: variable “$sessionID” of type “string” used in position expecting type “string!”.. as shown in Figure 1
{
"errors": [
{
"message": "Variable \"$sessionId\" of type \"String\" used in position expecting type \"String!\".",
"extensions": {
"category": "graphql"
},
"locations": [
{
"line": 2,
"column": 163
},
{
"line": 8,
"column": 16
}
]
}
]
}
2. View request query
mutation ThemeUpdate($themeId: ID!, $settings: [ThemeSettingDataInput!], $sections: [ThemeSettingsDataSectionInput!], $appEmbeds: [ThemeSettingsDataBlockInput!], $sessionId: String) {
onlineStoreThemeSettingsDataUpdate(
themeId: $themeId
settings: $settings
sections: $sections
appEmbeds: $appEmbeds
sessionId: $sessionId
) {
sessionId
__typename
}
}
3. Check the GraphQL document, $sessionId: String!. is missing !. as shown in Figure 2
4. After the adjustment in the request query, no more errors are reported. as shown in Figure 3
mutation ThemeUpdate($themeId: ID!, $settings: [ThemeSettingDataInput!], $sections: [ThemeSettingsDataSectionInput!], $appEmbeds: [ThemeSettingsDataBlockInput!], $sessionId: String!) {
onlineStoreThemeSettingsDataUpdate(
themeId: $themeId
settings: $settings
sections: $sections
appEmbeds: $appEmbeds
sessionId: $sessionId
) {
sessionId
__typename
}
}

