创建保存搜索-savedSearchCreate mutation
创建一个保存的搜索。
在本页面
互动范例
这是一个示例变异查询。
mutation savedSearchCreate($input: SavedSearchCreateInput!) { savedSearchCreate(input: $input) {} }
<font style="color:#1F61A0;">savedSearch</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">id</font><font style="color:#555555;">}</font><font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">field</font><font style="color:#1F61A0;">message</font><font style="color:#555555;">}</font>
变量:
{ “input”: {} }
<font style="color:#8B2BB9;">"resourceType"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">,</font><font style="color:#8B2BB9;">"name"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">,</font><font style="color:#8B2BB9;">"query"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font>
字段
| 字段 | 描述 | 
|---|---|
input( [SavedSearchCreateInput!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/savedsearchcreateinput)) 必需的  | 
指定保存的搜索的输入字段。 | 
SavedSearchCreateInput字段
- name(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)) 必需的
保存的搜索的描述性名称。 - query(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)) 必需的
保存的搜索的查询字符串。这包括搜索词和过滤器。 - resourceType(
[SearchResultType!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/searchresulttype)) 必需的
搜索此保存的搜索的资源类型。 
返回字段
- savedSearch(
[SavedSearch](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/savedsearch))
创建的保存的搜索。 - userErrors(
[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror))
执行mutation时发生的错误列表。 
