File tree 3 files changed +41
-0
lines changed
3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ $config = array(
40
40
'ShopUrl' => 'yourshop.myshopify.com',
41
41
'ApiKey' => '***YOUR-PRIVATE-API-KEY***',
42
42
'Password' => '***YOUR-PRIVATE-API-PASSWORD***',
43
+ 'AccessToken' => '***YOUR-PRIVATE-API-PASSWORD***', // optional but needed if you want to use graphql
43
44
);
44
45
45
46
PHPShopify\ShopifySDK::config($config);
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace PHPShopify ;
4
+
5
+ class GraphQLTest extends TestResource
6
+ {
7
+ /**
8
+ * GraphQLTest constructor.
9
+ */
10
+ public function __construct ()
11
+ {
12
+ parent ::__construct ();
13
+ }
14
+
15
+
16
+ /**
17
+ * GraphQL Query Test
18
+ */
19
+ public function testQuery ()
20
+ {
21
+ $ graphQL = <<<Query
22
+ query {
23
+ shop {
24
+ name
25
+ primaryDomain {
26
+ url
27
+ host
28
+ }
29
+ }
30
+ }
31
+ Query ;
32
+
33
+ $ return = static ::$ shopify ->GraphQL ->post ($ graphQL );
34
+
35
+ $ this ->assertNotEmpty ($ return ['data ' ]['shop ' ]);
36
+ }
37
+
38
+
39
+ }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ public static function setUpBeforeClass()
23
23
'ShopUrl ' => getenv ('SHOPIFY_SHOP_URL ' ), //Your shop URL
24
24
'ApiKey ' => getenv ('SHOPIFY_API_KEY ' ), //Your Private API Key
25
25
'Password ' => getenv ('SHOPIFY_API_PASSWORD ' ), //Your Private API Password
26
+ 'AccessToken ' => getenv ('SHOPIFY_API_PASSWORD ' ), //Your Access Token(Private API Password)
26
27
);
27
28
28
29
self ::$ shopify = ShopifySDK::config ($ config );
You can’t perform that action at this time.
0 commit comments