Closed aiden-dev closed 1 year ago
I'm trying to do a simple request but it gets stuck on categories every time.
categories
Request:
var query struct { StoreCategory struct { categories []struct { pageData struct { title string } } } `graphql:"StoreCategory"` } client.Query(context.Background(), &query, nil)
Response:
{ "data": { "StoreCategory": { "categories": [ { "pageData": { "title": "1" } }, { "pageData": { "title": "2" } } ] } } }
Error: Error: Message: struct field for "categories" doesn't exist in any of 1 places to unmarshal, Locations: [], Extensions: map[code:graphql_decode_error]
Error: Message: struct field for "categories" doesn't exist in any of 1 places to unmarshal, Locations: [], Extensions: map[code:graphql_decode_error]
Try making your query fields exported. Categories instead of categories, PageData not pageData, and Title not title.
Categories
PageData
pageData
Title
title
Thanks so much
I'm trying to do a simple request but it gets stuck on
categories
every time.Request:
Response:
Error:
Error: Message: struct field for "categories" doesn't exist in any of 1 places to unmarshal, Locations: [], Extensions: map[code:graphql_decode_error]