extend type Mutation {
  "Generate sitemap documents"
  generateSitemaps(
    "Mutation input"
    input: GenerateSitemapsInput
  ): GenerateSitemapsPayload!
}

"Input for the `generateSitemaps` mutation"
input GenerateSitemapsInput {
  "An optional string identifying the mutation call, which will be returned in the response payload"
  clientMutationId: String

  "The ID of the shop to generate sitemap for"
  shopId: ID!
}

"Response for the `generateSitemaps` mutation"
type GenerateSitemapsPayload {
  "The same string you sent with the mutation params, for matching mutation calls with their responses"
  clientMutationId: String

  "Whether the sitemap generation job was successfully scheduled"
  wasJobScheduled: Boolean!
}

extend type Query {
  "Returns Sitemap object for a shop based on the handle param"
  sitemap(
    "The sitemap handle"
    handle: String!,

    "Shop URL"
    shopUrl: String!
  ): Sitemap
}

"Generated sitemap XML for a single shop"
type Sitemap {
  "Date created"
  createdAt: Date!

  "The sitemap handle"
  handle: String!

  "The shop ID"
  shopId: String!

  "The Sitemap XML content"
  xml: String!
}
