MODULE_QUERY = """
query ModulesQuery($slug: String, $id: ID) {
  module(slug: $slug, id: $id) {
    id
    title
    objectiveGroups {
        objectives {
            id
            text
            hiddenFor {
                name
            }
            visibleFor {
                name
            }
        }
    }
    chapters {
        id
        titleHiddenFor { name }
        descriptionHiddenFor { name }
        contentBlocks {
            id
            title
            originalCreator {
              id
              fullName
              avatarUrl
            }
            visibleFor {
              name
            }
            hiddenFor {
              name
            }                    
        }
    }
  }  
}
"""

CREATE_SNAPSHOT_MUTATION = """
mutation CreateSnapshot($input: CreateSnapshotInput!) {
  createSnapshot(input: $input) {
    snapshot {
      id
      created
      creator 
      objectiveGroups {
        objectives {
            text
            hidden
        }
      }
      chapters {
        id
        descriptionHidden
        titleHidden
        title
        description
        contentBlocks {
          id
          title
          hidden
        }
      }
    }
    success
  }
}
"""
APPLY_SNAPSHOT_MUTATION = """
mutation ApplySnapshot($input: ApplySnapshotInput!) {
    applySnapshot(input: $input) {
        success
    }
}
"""

SNAPSHOT_MODULE_QUERY = """
query SnapshotDetail($id: ID!) {
  snapshot(id: $id) {
    id
    changes {
      newContentBlocks
      newObjectives
      hiddenContentBlocks
      hiddenObjectives
    }    
    objectiveGroups {
      title
      id
      hidden
      objectives {
        hidden
        id
        text
      }
    }
    chapters {
      id
      description
      title
      titleHidden
      descriptionHidden
      contentBlocks {
        id
        title
        hidden
      }
    }
  }
}
"""

SHARE_SNAPSHOT_MUTATION = """
mutation ShareSnapshot($input: ShareSnapshotInput!) {
  shareSnapshot(input: $input) {
    success
    snapshot {
      shared
    }
  }
}
"""

MODULE_SNAPSHOTS_QUERY = """
query SnapshotQuery($slug: String!) {
  module(slug: $slug) {
    snapshots {
      id
      title
      created
      creator
    }
  }
}
"""
