imsujan276 / shopify_flutter

A flutter package that works as a bridge between your Shopify Store and Flutter Application
https://pub.dev/packages/shopify_flutter
MIT License
26 stars 27 forks source link

Erro while fetching products #81

Closed IbrahimHasan93 closed 2 months ago

IbrahimHasan93 commented 2 months ago

OperationException(linkException: ServerException(originalException: null, originalStackTrace: null, parsedResponse: Response(data: null, errors: [GraphQLError(message: , locations: null, path: null, extensions: {code: UNAUTHORIZED})], context: Context({ResponseExtensions: Instance of 'ResponseExtensions'}), response {errors: [{message: , extensions: {code: UNAUTHORIZED}}]})), graphqlErrors: [])

this is the error am getting every time am trying to use the pakcage, @imsujan276 is this how to initialize in main()? ShopifyConfig.setConfig( storefrontAccessToken: '123123123123234e123123', storeUrl: '123123-e3.myshopify.com', adminAccessToken: "shpat_123123123123b123123213ee123123", // Optional | Needed only if needed to call admin api storefrontApiVersion: '2024-01', // optional | default: 2024-07 cachePolicy: CachePolicy.cacheAndNetwork, // optional | default: null language: 'en' // Store locale | default : en ); i need to know if this serConfig looks true, am confused, why isn't this package working for me??

imsujan276 commented 2 months ago

That is the correct way to set the configuration.

I suggest you to use the latest stable version of shopify storefront API i.e. 2024-07

IbrahimHasan93 commented 2 months ago

@imsujan276 it worked for me, the problem was in storefront dashboad, i should add permissions to the app, shopify docs are confusing, i didn't find it until i watch a youtube video, and now in my app all set up except the checkout confirmation and payment, but great work this package, thank you

imsujan276 commented 2 months ago

Glad it was resolved.