Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Angular example #34

Closed
JsssCode opened this issue Sep 9, 2017 · 11 comments
Closed

Angular example #34

JsssCode opened this issue Sep 9, 2017 · 11 comments

Comments

@JsssCode
Copy link
Contributor

JsssCode commented Sep 9, 2017

I have developed Angular 4 Storefront API example https://github.com/JsssCode/SmallAwesomeShop.
Maybe it would be helpful to someone.
Looking forward to adding it to this repo!

@magic-77
Copy link

magic-77 commented May 1, 2018

@JsssCode Hi, thanks for this example App. It is useful for me, because i'm developing an Shopify App using Ionic 3.
Do you know how to implement a Customer Login Page?
Right now, i am using the Shopify Buy SDK.

@JsssCode
Copy link
Contributor Author

@magic-77 Great that it helps you. No, I didn't work on this

@magic-77
Copy link

@JsssCode Hi, i refactored my app, now using Storefront API + Admin API. This works much better

@ribalnasr
Copy link

ribalnasr commented Jun 9, 2018

@magic-77 can you please show how you got the admin api to work. for now i'm struggling with types.ts, how can i generate that file for the admin graphql client?

@magic-77
Copy link

magic-77 commented Jun 9, 2018

@ribalnasr You can fetch it this way:

graphql-js-schema-fetch --url 'https://apikey:password@<your-shop-name>.myshopify.com/admin/api/graphql.json' | jq '.' > schema.json

To get the right URL for https://apikey:password@, login to Admin and copy it from the Field "Example url"

@ribalnasr
Copy link

@magic-77 can you stay with me on this one please, am extremely new to graphql.

this line does not work:
$ graphql-js-schema-fetch --url 'https://apikey:password@<your-shop-name>.myshopify.com/admin/api/graphql.json' | jq '.' > schema.json

Error: Cannot find module 'commander'

when i try to run it without | jq '.' it works and creates the file schema.json.

however i believe what am looking for is a .ts file like this one
https://github.com/JsssCode/SmallAwesomeShop/blob/master/src/app/shared/services/types.ts
correct?

@magic-77
Copy link

magic-77 commented Jun 15, 2018

You have to convert json schema to types like this

graphql-js-schema --schema-file schema.json --outdir ./src --schema-bundle-name 'Types' --bundle-only

@sutkovoy
Copy link

Thanks for example

@swalkinshaw
Copy link
Collaborator

Closing since the Angular example has been merged.

@Dharma-DX
Copy link

@JsssCode your angular 4 code is helpfull for me ,
i stucked in CORS issue for Shopify REST API Post Method for add Product. now to try to use proxy ,if any one faced the same issue please help me.
Thanks.

@JsssCode
Copy link
Contributor Author

@Dharma-DX I didn't face CORS problem for Shopify, but you could try to run Chrome without CORS, like described here https://alfilatov.com/posts/run-chrome-without-cors/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants