@gem-sdk/core 1.43.0-dev.80 → 1.43.0-dev.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,13 +8,12 @@ const ArticleListContext = /*#__PURE__*/ react.createContext(null);
8
8
  const createArticleListProvider = (data)=>zustand.createStore(()=>({
9
9
  ...data
10
10
  }));
11
- const ArticleListProvider = ({ articles, blogs, children, styles, settings })=>{
11
+ const ArticleListProvider = ({ articles, children, styles, settings })=>{
12
12
  return /*#__PURE__*/ jsxRuntime.jsx(ArticleListContext.Provider, {
13
13
  value: createArticleListProvider({
14
14
  articles,
15
15
  styles,
16
- settings,
17
- blogs
16
+ settings
18
17
  }),
19
18
  children: children
20
19
  });
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ const ArticlesDocument = `
4
+ query articles($after: Cursor, $before: Cursor, $first: Int, $last: Int, $orderBy: ArticleOrder, $where: ArticleWhereInput) {
5
+ articles(
6
+ after: $after
7
+ before: $before
8
+ first: $first
9
+ last: $last
10
+ orderBy: $orderBy
11
+ where: $where
12
+ ) {
13
+ edges {
14
+ cursor
15
+ node {
16
+ id
17
+ title
18
+ handle
19
+ description
20
+ templateSuffix
21
+ titleMeta
22
+ descriptionMeta
23
+ baseID
24
+ platform
25
+ tags
26
+ isSample
27
+ platformCreatedAt
28
+ author
29
+ blogs {
30
+ edges {
31
+ node {
32
+ title
33
+ }
34
+ }
35
+ }
36
+ media {
37
+ alt
38
+ width
39
+ src
40
+ height
41
+ }
42
+ }
43
+ }
44
+ pageInfo {
45
+ endCursor
46
+ hasNextPage
47
+ hasPreviousPage
48
+ startCursor
49
+ }
50
+ totalCount
51
+ }
52
+ }
53
+ `;
54
+
55
+ exports.ArticlesDocument = ArticlesDocument;
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ const BlogsDocument = `
4
+ query blogs($after: Cursor, $before: Cursor, $first: Int, $last: Int, $orderBy: BlogOrder, $where: BlogWhereInput) {
5
+ blogs(
6
+ after: $after
7
+ before: $before
8
+ first: $first
9
+ last: $last
10
+ orderBy: $orderBy
11
+ where: $where
12
+ ) {
13
+ edges {
14
+ cursor
15
+ node {
16
+ baseID
17
+ description
18
+ descriptionMeta
19
+ handle
20
+ articles {
21
+ edges {
22
+ node {
23
+ id
24
+ title
25
+ handle
26
+ description
27
+ templateSuffix
28
+ titleMeta
29
+ descriptionMeta
30
+ baseID
31
+ tags
32
+ isSample
33
+ platformCreatedAt
34
+ author
35
+ media {
36
+ width
37
+ src
38
+ height
39
+ }
40
+ }
41
+ }
42
+ totalCount
43
+ }
44
+ id
45
+ platform
46
+ tags
47
+ templateSuffix
48
+ title
49
+ titleMeta
50
+ }
51
+ }
52
+ pageInfo {
53
+ endCursor
54
+ hasNextPage
55
+ hasPreviousPage
56
+ startCursor
57
+ }
58
+ totalCount
59
+ }
60
+ }
61
+ `;
62
+
63
+ exports.BlogsDocument = BlogsDocument;
@@ -1,151 +1,31 @@
1
1
  'use strict';
2
2
 
3
- const mock = [
4
- {
5
- baseID: 'gid://shopify/OnlineStoreBlog/592066740457',
6
- id: 592066740457,
7
- title: 'Blog post might appear in a search engine listing',
8
- created_at: '2024-05-09T04:06:12-04:00',
9
- body_html: '<span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span>',
10
- blog_id: 91970044137,
11
- author: 'Dev Team',
12
- user_id: 90371653865,
13
- published_at: '2024-05-09T04:06:12-04:00',
14
- updated_at: '2024-05-09T04:06:13-04:00',
15
- summary_html: '',
16
- template_suffix: '',
17
- handle: 'blog-post-might-appear-in-a-search-engine-listing',
18
- tags: 'vintage',
19
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592066740457',
20
- image: {
21
- created_at: '2024-05-09T04:06:12-04:00',
22
- alt: '',
23
- width: 1073,
24
- height: 719,
25
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_2.jpg?v=1715241973'
26
- }
27
- },
28
- {
29
- baseID: 'gid://shopify/OnlineStoreBlog/592066707689',
30
- id: 592066707689,
31
- title: 'ar on your home page or blog.',
32
- created_at: '2024-05-09T04:05:26-04:00',
33
- body_html: '<span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span>',
34
- blog_id: 91970044137,
35
- author: 'Dev Team',
36
- user_id: 90371653865,
37
- published_at: '2024-05-09T04:05:25-04:00',
38
- updated_at: '2024-05-09T05:35:29-04:00',
39
- summary_html: '',
40
- template_suffix: '',
41
- handle: 'ar-on-your-home-page-or-blog',
42
- tags: 'cotton, vintage',
43
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592066707689',
44
- image: {
45
- created_at: '2024-05-09T04:05:26-04:00',
46
- alt: '',
47
- width: 1080,
48
- height: 719,
49
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_1.jpg?v=1715241926'
50
- }
51
- },
52
- {
53
- baseID: 'gid://shopify/OnlineStoreBlog/592066674921',
54
- id: 592066674921,
55
- title: 'Add a summary of the post.',
56
- created_at: '2024-05-09T04:04:44-04:00',
57
- body_html: '<span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span>',
58
- blog_id: 91970044137,
59
- author: 'Dev Team',
60
- user_id: 90371653865,
61
- published_at: '2024-05-09T04:04:44-04:00',
62
- updated_at: '2024-05-09T04:04:45-04:00',
63
- summary_html: '',
64
- template_suffix: '',
65
- handle: 'add-a-summary-of-the-post',
66
- tags: '',
67
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592066674921',
68
- image: {
69
- created_at: '2024-05-09T04:04:44-04:00',
70
- alt: '',
71
- width: 1086,
72
- height: 718,
73
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_7.jpg?v=1715241885'
74
- }
75
- },
76
- {
77
- baseID: 'gid://shopify/OnlineStoreBlog/592058777833',
78
- id: 592058777833,
79
- title: 'Article Page - May 7, 10:47:14',
80
- created_at: '2024-05-06T23:47:59-04:00',
81
- body_html: '<h2>\n<span>Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span>\n</h2>',
82
- blog_id: 91970044137,
83
- author: 'GemPages',
84
- user_id: null,
85
- published_at: '2024-05-06T23:47:59-04:00',
86
- updated_at: '2024-05-09T04:06:48-04:00',
87
- summary_html: '',
88
- template_suffix: 'gp-template-512584275137135821',
89
- handle: 'article-page-may-7-10-47-14',
90
- tags: 'vintage',
91
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592058777833',
92
- image: {
93
- created_at: '2024-05-09T04:06:41-04:00',
94
- alt: '',
95
- width: 578,
96
- height: 585,
97
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_3.png?v=1715242002'
98
- }
99
- },
100
- {
101
- baseID: 'gid://shopify/OnlineStoreBlog/592058679529',
102
- id: 592058679529,
103
- title: 'Blog about your latest products or deals',
104
- created_at: '2024-05-06T22:36:55-04:00',
105
- body_html: '<span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span>',
106
- blog_id: 91970044137,
107
- author: 'Dev Team',
108
- user_id: 90371653865,
109
- published_at: '2024-05-06T22:36:54-04:00',
110
- updated_at: '2024-05-09T03:46:39-04:00',
111
- summary_html: '<span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span>',
112
- template_suffix: 'gp-template-512584275137135821',
113
- handle: 'blog-about-your-latest-products-or-deals',
114
- tags: '',
115
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592058679529',
116
- image: {
117
- created_at: '2024-05-06T22:36:55-04:00',
118
- alt: '',
119
- width: 497,
120
- height: 618,
121
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_3.jpg?v=1715049415'
122
- }
123
- }
124
- ];
125
- const useArticlesQuery = ()=>{
126
- return mock;
3
+ var articles_generated = require('../../graphql/queries/articles.generated.js');
4
+ var useFetchHandle = require('../useFetchHandle.js');
5
+ var useSWR = require('swr');
6
+ var blogs_generated = require('../../graphql/queries/blogs.generated.js');
7
+
8
+ const useArticlesQuery = (variables, options)=>{
9
+ const fetcher = useFetchHandle.useFetchHandle();
10
+ const fetchArticles = ()=>fetcher([
11
+ articles_generated.ArticlesDocument,
12
+ variables ?? {}
13
+ ]);
14
+ return useSWR(variables ? [
15
+ 'query/articles',
16
+ variables
17
+ ] : null, fetchArticles, options);
127
18
  };
128
- const useBlogsQuery = ()=>{
129
- return {
130
- blogs: {
131
- edges: [
132
- {
133
- node: {
134
- id: '511006979737518962',
135
- title: 'News',
136
- baseID: 'gid://shopify/OnlineStoreBlog/91970044137',
137
- tags: [],
138
- handle: 'news',
139
- descriptionMeta: '',
140
- description: '',
141
- titleMeta: '',
142
- templateSuffix: '',
143
- platform: 'SHOPIFY'
144
- }
145
- }
146
- ]
147
- }
148
- };
19
+ const useBlogsQuery = (variables, options)=>{
20
+ const fetcher = useFetchHandle.useFetchHandle();
21
+ const fetchBlogs = ()=>fetcher([
22
+ blogs_generated.BlogsDocument,
23
+ variables ?? {}
24
+ ]);
25
+ return useSWR(variables ? [
26
+ 'query/blogs',
27
+ variables
28
+ ] : null, fetchBlogs, options);
149
29
  };
150
30
 
151
31
  exports.useArticlesQuery = useArticlesQuery;
@@ -6,13 +6,12 @@ const ArticleListContext = /*#__PURE__*/ createContext(null);
6
6
  const createArticleListProvider = (data)=>createStore(()=>({
7
7
  ...data
8
8
  }));
9
- const ArticleListProvider = ({ articles, blogs, children, styles, settings })=>{
9
+ const ArticleListProvider = ({ articles, children, styles, settings })=>{
10
10
  return /*#__PURE__*/ jsx(ArticleListContext.Provider, {
11
11
  value: createArticleListProvider({
12
12
  articles,
13
13
  styles,
14
- settings,
15
- blogs
14
+ settings
16
15
  }),
17
16
  children: children
18
17
  });
@@ -0,0 +1,53 @@
1
+ const ArticlesDocument = `
2
+ query articles($after: Cursor, $before: Cursor, $first: Int, $last: Int, $orderBy: ArticleOrder, $where: ArticleWhereInput) {
3
+ articles(
4
+ after: $after
5
+ before: $before
6
+ first: $first
7
+ last: $last
8
+ orderBy: $orderBy
9
+ where: $where
10
+ ) {
11
+ edges {
12
+ cursor
13
+ node {
14
+ id
15
+ title
16
+ handle
17
+ description
18
+ templateSuffix
19
+ titleMeta
20
+ descriptionMeta
21
+ baseID
22
+ platform
23
+ tags
24
+ isSample
25
+ platformCreatedAt
26
+ author
27
+ blogs {
28
+ edges {
29
+ node {
30
+ title
31
+ }
32
+ }
33
+ }
34
+ media {
35
+ alt
36
+ width
37
+ src
38
+ height
39
+ }
40
+ }
41
+ }
42
+ pageInfo {
43
+ endCursor
44
+ hasNextPage
45
+ hasPreviousPage
46
+ startCursor
47
+ }
48
+ totalCount
49
+ }
50
+ }
51
+ `;
52
+
53
+ export { ArticlesDocument };
@@ -0,0 +1,61 @@
1
+ const BlogsDocument = `
2
+ query blogs($after: Cursor, $before: Cursor, $first: Int, $last: Int, $orderBy: BlogOrder, $where: BlogWhereInput) {
3
+ blogs(
4
+ after: $after
5
+ before: $before
6
+ first: $first
7
+ last: $last
8
+ orderBy: $orderBy
9
+ where: $where
10
+ ) {
11
+ edges {
12
+ cursor
13
+ node {
14
+ baseID
15
+ description
16
+ descriptionMeta
17
+ handle
18
+ articles {
19
+ edges {
20
+ node {
21
+ id
22
+ title
23
+ handle
24
+ description
25
+ templateSuffix
26
+ titleMeta
27
+ descriptionMeta
28
+ baseID
29
+ tags
30
+ isSample
31
+ platformCreatedAt
32
+ author
33
+ media {
34
+ width
35
+ src
36
+ height
37
+ }
38
+ }
39
+ }
40
+ totalCount
41
+ }
42
+ id
43
+ platform
44
+ tags
45
+ templateSuffix
46
+ title
47
+ titleMeta
48
+ }
49
+ }
50
+ pageInfo {
51
+ endCursor
52
+ hasNextPage
53
+ hasPreviousPage
54
+ startCursor
55
+ }
56
+ totalCount
57
+ }
58
+ }
59
+ `;
60
+
61
+ export { BlogsDocument };
@@ -1,149 +1,29 @@
1
- const mock = [
2
- {
3
- baseID: 'gid://shopify/OnlineStoreBlog/592066740457',
4
- id: 592066740457,
5
- title: 'Blog post might appear in a search engine listing',
6
- created_at: '2024-05-09T04:06:12-04:00',
7
- body_html: '<span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span>',
8
- blog_id: 91970044137,
9
- author: 'Dev Team',
10
- user_id: 90371653865,
11
- published_at: '2024-05-09T04:06:12-04:00',
12
- updated_at: '2024-05-09T04:06:13-04:00',
13
- summary_html: '',
14
- template_suffix: '',
15
- handle: 'blog-post-might-appear-in-a-search-engine-listing',
16
- tags: 'vintage',
17
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592066740457',
18
- image: {
19
- created_at: '2024-05-09T04:06:12-04:00',
20
- alt: '',
21
- width: 1073,
22
- height: 719,
23
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_2.jpg?v=1715241973'
24
- }
25
- },
26
- {
27
- baseID: 'gid://shopify/OnlineStoreBlog/592066707689',
28
- id: 592066707689,
29
- title: 'ar on your home page or blog.',
30
- created_at: '2024-05-09T04:05:26-04:00',
31
- body_html: '<span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span>',
32
- blog_id: 91970044137,
33
- author: 'Dev Team',
34
- user_id: 90371653865,
35
- published_at: '2024-05-09T04:05:25-04:00',
36
- updated_at: '2024-05-09T05:35:29-04:00',
37
- summary_html: '',
38
- template_suffix: '',
39
- handle: 'ar-on-your-home-page-or-blog',
40
- tags: 'cotton, vintage',
41
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592066707689',
42
- image: {
43
- created_at: '2024-05-09T04:05:26-04:00',
44
- alt: '',
45
- width: 1080,
46
- height: 719,
47
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_1.jpg?v=1715241926'
48
- }
49
- },
50
- {
51
- baseID: 'gid://shopify/OnlineStoreBlog/592066674921',
52
- id: 592066674921,
53
- title: 'Add a summary of the post.',
54
- created_at: '2024-05-09T04:04:44-04:00',
55
- body_html: '<span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span><span data-mce-fragment="1">Add a title and description to see how this Blog post might appear in a search engine listing</span>',
56
- blog_id: 91970044137,
57
- author: 'Dev Team',
58
- user_id: 90371653865,
59
- published_at: '2024-05-09T04:04:44-04:00',
60
- updated_at: '2024-05-09T04:04:45-04:00',
61
- summary_html: '',
62
- template_suffix: '',
63
- handle: 'add-a-summary-of-the-post',
64
- tags: '',
65
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592066674921',
66
- image: {
67
- created_at: '2024-05-09T04:04:44-04:00',
68
- alt: '',
69
- width: 1086,
70
- height: 718,
71
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_7.jpg?v=1715241885'
72
- }
73
- },
74
- {
75
- baseID: 'gid://shopify/OnlineStoreBlog/592058777833',
76
- id: 592058777833,
77
- title: 'Article Page - May 7, 10:47:14',
78
- created_at: '2024-05-06T23:47:59-04:00',
79
- body_html: '<h2>\n<span>Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span>\n</h2>',
80
- blog_id: 91970044137,
81
- author: 'GemPages',
82
- user_id: null,
83
- published_at: '2024-05-06T23:47:59-04:00',
84
- updated_at: '2024-05-09T04:06:48-04:00',
85
- summary_html: '',
86
- template_suffix: 'gp-template-512584275137135821',
87
- handle: 'article-page-may-7-10-47-14',
88
- tags: 'vintage',
89
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592058777833',
90
- image: {
91
- created_at: '2024-05-09T04:06:41-04:00',
92
- alt: '',
93
- width: 578,
94
- height: 585,
95
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_3.png?v=1715242002'
96
- }
97
- },
98
- {
99
- baseID: 'gid://shopify/OnlineStoreBlog/592058679529',
100
- id: 592058679529,
101
- title: 'Blog about your latest products or deals',
102
- created_at: '2024-05-06T22:36:55-04:00',
103
- body_html: '<span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span><span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span>',
104
- blog_id: 91970044137,
105
- author: 'Dev Team',
106
- user_id: 90371653865,
107
- published_at: '2024-05-06T22:36:54-04:00',
108
- updated_at: '2024-05-09T03:46:39-04:00',
109
- summary_html: '<span data-mce-fragment="1">Add a summary of the post to appear on your home page or blog.</span>',
110
- template_suffix: 'gp-template-512584275137135821',
111
- handle: 'blog-about-your-latest-products-or-deals',
112
- tags: '',
113
- admin_graphql_api_id: 'gid://shopify/OnlineStoreArticle/592058679529',
114
- image: {
115
- created_at: '2024-05-06T22:36:55-04:00',
116
- alt: '',
117
- width: 497,
118
- height: 618,
119
- src: 'https://cdn.shopify.com/s/files/1/0692/6562/1225/articles/Screenshot_3.jpg?v=1715049415'
120
- }
121
- }
122
- ];
123
- const useArticlesQuery = ()=>{
124
- return mock;
1
+ import { ArticlesDocument } from '../../graphql/queries/articles.generated.js';
2
+ import { useFetchHandle } from '../useFetchHandle.js';
3
+ import useSWR from 'swr';
4
+ import { BlogsDocument } from '../../graphql/queries/blogs.generated.js';
5
+
6
+ const useArticlesQuery = (variables, options)=>{
7
+ const fetcher = useFetchHandle();
8
+ const fetchArticles = ()=>fetcher([
9
+ ArticlesDocument,
10
+ variables ?? {}
11
+ ]);
12
+ return useSWR(variables ? [
13
+ 'query/articles',
14
+ variables
15
+ ] : null, fetchArticles, options);
125
16
  };
126
- const useBlogsQuery = ()=>{
127
- return {
128
- blogs: {
129
- edges: [
130
- {
131
- node: {
132
- id: '511006979737518962',
133
- title: 'News',
134
- baseID: 'gid://shopify/OnlineStoreBlog/91970044137',
135
- tags: [],
136
- handle: 'news',
137
- descriptionMeta: '',
138
- description: '',
139
- titleMeta: '',
140
- templateSuffix: '',
141
- platform: 'SHOPIFY'
142
- }
143
- }
144
- ]
145
- }
146
- };
17
+ const useBlogsQuery = (variables, options)=>{
18
+ const fetcher = useFetchHandle();
19
+ const fetchBlogs = ()=>fetcher([
20
+ BlogsDocument,
21
+ variables ?? {}
22
+ ]);
23
+ return useSWR(variables ? [
24
+ 'query/blogs',
25
+ variables
26
+ ] : null, fetchBlogs, options);
147
27
  };
148
28
 
149
29
  export { useArticlesQuery, useBlogsQuery };
@@ -61,6 +61,7 @@ type Analytic$1 = {
61
61
  tiktokPixelID?: Maybe$1<Scalars$2['String']>;
62
62
  };
63
63
  type Article$2 = {
64
+ author?: Maybe$1<Scalars$2['String']>;
64
65
  baseID?: Maybe$1<Scalars$2['String']>;
65
66
  blogs?: Maybe$1<BlogConnection$1>;
66
67
  description?: Maybe$1<Scalars$2['String']>;
@@ -68,8 +69,10 @@ type Article$2 = {
68
69
  handle?: Maybe$1<Scalars$2['String']>;
69
70
  id: Scalars$2['ID'];
70
71
  isSample?: Maybe$1<Scalars$2['Boolean']>;
72
+ media?: Maybe$1<Media$1>;
71
73
  metafield?: Maybe$1<Metafield$1>;
72
74
  platform?: Maybe$1<ArticlePlatform$1>;
75
+ platformCreatedAt?: Maybe$1<Scalars$2['Time']>;
73
76
  tags: Array<Scalars$2['String']>;
74
77
  templateSuffix?: Maybe$1<Scalars$2['String']>;
75
78
  title?: Maybe$1<Scalars$2['String']>;
@@ -6947,7 +6950,7 @@ type InputNumberControlType<T> = SharedControlType<T> & {
6947
6950
  readonly?: boolean;
6948
6951
  };
6949
6952
 
6950
- type SizeUnit$2 = 's' | '%' | 'cm' | 'mm' | 'Q' | 'in' | 'pc' | 'pt' | 'px' | 'em' | 'cap' | 'ex' | 'ch' | 'ic' | 'rem' | 'lh' | 'rlh' | 'vw' | 'vh' | 'vi' | 'vb' | 'vmin' | 'vmax' | 'ms' | 'min';
6953
+ type SizeUnit$2 = 's' | '%' | 'cm' | 'mm' | 'Q' | 'in' | 'pc' | 'pt' | 'px' | 'em' | 'cap' | 'ex' | 'ch' | 'ic' | 'rem' | 'lh' | 'rlh' | 'vw' | 'vh' | 'vi' | 'vb' | 'vmin' | 'vmax' | 'ms' | 'min' | 'days';
6951
6954
  type InputUnitControlType<T> = SharedControlType<T> & {
6952
6955
  type: 'input:unit';
6953
6956
  placeholder?: string;
@@ -27655,7 +27658,6 @@ declare const useModalStore: <U>(selector: (state: ExtractState<StoreApi<ModalCo
27655
27658
 
27656
27659
  type ArticleListContextProps = {
27657
27660
  articles?: any[];
27658
- blogs?: Blog$1[];
27659
27661
  settings?: {
27660
27662
  slidesToShow?: ObjectDevices<number | 'auto'>;
27661
27663
  };
@@ -35966,63 +35968,57 @@ declare const useMoney: (amount: number) => UseMoneyValue;
35966
35968
 
35967
35969
  declare const usePrevious: <T>(value: T) => T | undefined;
35968
35970
 
35971
+ type ArticlesQueryVariables = Exact$1<{
35972
+ after?: InputMaybe$1<Scalars$2['Cursor']>;
35973
+ before?: InputMaybe$1<Scalars$2['Cursor']>;
35974
+ first?: InputMaybe$1<Scalars$2['Int']>;
35975
+ last?: InputMaybe$1<Scalars$2['Int']>;
35976
+ orderBy?: InputMaybe$1<ArticleOrder$1>;
35977
+ where?: InputMaybe$1<ArticleWhereInput$1>;
35978
+ }>;
35979
+ type ArticlesQueryResponse = {
35980
+ articles?: Maybe$1<(Pick<ArticleConnection$1, 'totalCount'> & {
35981
+ edges: Array<(Pick<ArticleEdge$1, 'cursor'> & {
35982
+ node?: Maybe$1<(Pick<Article$2, 'id' | 'title' | 'handle' | 'description' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'platform' | 'tags' | 'isSample' | 'platformCreatedAt' | 'author'> & {
35983
+ blogs?: Maybe$1<{
35984
+ edges: Array<{
35985
+ node?: Maybe$1<Pick<Blog$1, 'title'>>;
35986
+ }>;
35987
+ }>;
35988
+ media?: Maybe$1<Pick<Media$1, 'alt' | 'width' | 'src' | 'height'>>;
35989
+ })>;
35990
+ })>;
35991
+ pageInfo?: Maybe$1<Pick<PageInfo$1, 'endCursor' | 'hasNextPage' | 'hasPreviousPage' | 'startCursor'>>;
35992
+ })>;
35993
+ };
35994
+
35995
+ type BlogsQueryVariables = Exact$1<{
35996
+ after?: InputMaybe$1<Scalars$2['Cursor']>;
35997
+ before?: InputMaybe$1<Scalars$2['Cursor']>;
35998
+ first?: InputMaybe$1<Scalars$2['Int']>;
35999
+ last?: InputMaybe$1<Scalars$2['Int']>;
36000
+ orderBy?: InputMaybe$1<BlogOrder$1>;
36001
+ where?: InputMaybe$1<BlogWhereInput$1>;
36002
+ }>;
35969
36003
  type BlogsQueryResponse = {
35970
- blogs?: Maybe$1<Pick<BlogConnection$1, 'totalCount'> & {
35971
- edges: Array<Pick<BlogEdge$1, 'cursor'> & {
35972
- node?: Maybe$1<Pick<Blog$1, 'baseID' | 'description' | 'descriptionMeta' | 'handle' | 'id' | 'platform' | 'tags' | 'templateSuffix' | 'title' | 'titleMeta'>>;
35973
- }>;
36004
+ blogs?: Maybe$1<(Pick<BlogConnection$1, 'totalCount'> & {
36005
+ edges: Array<(Pick<BlogEdge$1, 'cursor'> & {
36006
+ node?: Maybe$1<(Pick<Blog$1, 'baseID' | 'description' | 'descriptionMeta' | 'handle' | 'id' | 'platform' | 'tags' | 'templateSuffix' | 'title' | 'titleMeta'> & {
36007
+ articles?: Maybe$1<(Pick<ArticleConnection$1, 'totalCount'> & {
36008
+ edges: Array<{
36009
+ node?: Maybe$1<(Pick<Article$2, 'id' | 'title' | 'handle' | 'description' | 'templateSuffix' | 'titleMeta' | 'descriptionMeta' | 'baseID' | 'tags' | 'isSample' | 'platformCreatedAt' | 'author'> & {
36010
+ media?: Maybe$1<Pick<Media$1, 'width' | 'src' | 'height'>>;
36011
+ })>;
36012
+ }>;
36013
+ })>;
36014
+ })>;
36015
+ })>;
35974
36016
  pageInfo?: Maybe$1<Pick<PageInfo$1, 'endCursor' | 'hasNextPage' | 'hasPreviousPage' | 'startCursor'>>;
35975
- }>;
36017
+ })>;
35976
36018
  };
35977
36019
 
35978
- declare const useArticlesQuery: () => ({
35979
- baseID: string;
35980
- id: number;
35981
- title: string;
35982
- created_at: string;
35983
- body_html: string;
35984
- blog_id: number;
35985
- author: string;
35986
- user_id: number;
35987
- published_at: string;
35988
- updated_at: string;
35989
- summary_html: string;
35990
- template_suffix: string;
35991
- handle: string;
35992
- tags: string;
35993
- admin_graphql_api_id: string;
35994
- image: {
35995
- created_at: string;
35996
- alt: string;
35997
- width: number;
35998
- height: number;
35999
- src: string;
36000
- };
36001
- } | {
36002
- baseID: string;
36003
- id: number;
36004
- title: string;
36005
- created_at: string;
36006
- body_html: string;
36007
- blog_id: number;
36008
- author: string;
36009
- user_id: null;
36010
- published_at: string;
36011
- updated_at: string;
36012
- summary_html: string;
36013
- template_suffix: string;
36014
- handle: string;
36015
- tags: string;
36016
- admin_graphql_api_id: string;
36017
- image: {
36018
- created_at: string;
36019
- alt: string;
36020
- width: number;
36021
- height: number;
36022
- src: string;
36023
- };
36024
- })[];
36025
- declare const useBlogsQuery: () => BlogsQueryResponse;
36020
+ declare const useArticlesQuery: (variables: ArticlesQueryVariables | null, options?: SWRConfiguration<ArticlesQueryResponse>) => swr__internal.SWRResponse<ArticlesQueryResponse, any, Partial<swr__internal.PublicConfiguration<ArticlesQueryResponse, any, (arg: ["query/articles", any]) => swr__internal.FetcherResponse<ArticlesQueryResponse>>> | undefined>;
36021
+ declare const useBlogsQuery: (variables: BlogsQueryVariables | null, options?: SWRConfiguration<BlogsQueryResponse>) => swr__internal.SWRResponse<BlogsQueryResponse, any, Partial<swr__internal.PublicConfiguration<BlogsQueryResponse, any, (arg: ["query/blogs", any]) => swr__internal.FetcherResponse<BlogsQueryResponse>>> | undefined>;
36026
36022
 
36027
36023
  declare const useUniqProductID: () => string;
36028
36024
  declare const useProduct: () => ProductSelectFragment | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.43.0-dev.80",
3
+ "version": "1.43.0-dev.82",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",