Skip to main content

SEARCH_BATCH

Constant SEARCH_BATCH 

Source
pub const SEARCH_BATCH: &str = "query($owner:String!,$number:Int!,$type:SearchType!,$search0:String!,$after0:String,$first0:Int!,$ask0:Boolean!,$search1:String!,$after1:String,$first1:Int!,$ask1:Boolean!,$search2:String!,$after2:String,$first2:Int!,$ask2:Boolean!,$search3:String!,$after3:String,$first3:Int!,$ask3:Boolean!,$search4:String!,$after4:String,$first4:Int!,$ask4:Boolean!,$search5:String!,$after5:String,$first5:Int!,$ask5:Boolean!,$search6:String!,$after6:String,$first6:Int!,$ask6:Boolean!,$search7:String!,$after7:String,$first7:Int!,$ask7:Boolean!,$search8:String!,$after8:String,$first8:Int!,$ask8:Boolean!,$search9:String!,$after9:String,$first9:Int!,$ask9:Boolean!,$search10:String!,$after10:String,$first10:Int!,$ask10:Boolean!,$search11:String!,$after11:String,$first11:Int!,$ask11:Boolean!,$search12:String!,$after12:String,$first12:Int!,$ask12:Boolean!,$search13:String!,$after13:String,$first13:Int!,$ask13:Boolean!,$search14:String!,$after14:String,$first14:Int!,$ask14:Boolean!,$search15:String!,$after15:String,$first15:Int!,$ask15:Boolean!,$search16:String!,$after16:String,$first16:Int!,$ask16:Boolean!,$search17:String!,$after17:String,$first17:Int!,$ask17:Boolean!,$search18:String!,$after18:String,$first18:Int!,$ask18:Boolean!,$search19:String!,$after19:String,$first19:Int!,$ask19:Boolean!,$filter0:String!,$itemsAfter0:String,$itemsFirst0:Int!,$origin0:Boolean!,$filter1:String!,$itemsAfter1:String,$itemsFirst1:Int!,$origin1:Boolean!,$filter2:String!,$itemsAfter2:String,$itemsFirst2:Int!,$origin2:Boolean!,$filter3:String!,$itemsAfter3:String,$itemsFirst3:Int!,$origin3:Boolean!,$filter4:String!,$itemsAfter4:String,$itemsFirst4:Int!,$origin4:Boolean!){\n      s0:search(query:$search0,type:$type,first:$first0,after:$after0) @include(if:$ask0){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s1:search(query:$search1,type:$type,first:$first1,after:$after1) @include(if:$ask1){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s2:search(query:$search2,type:$type,first:$first2,after:$after2) @include(if:$ask2){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s3:search(query:$search3,type:$type,first:$first3,after:$after3) @include(if:$ask3){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s4:search(query:$search4,type:$type,first:$first4,after:$after4) @include(if:$ask4){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s5:search(query:$search5,type:$type,first:$first5,after:$after5) @include(if:$ask5){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s6:search(query:$search6,type:$type,first:$first6,after:$after6) @include(if:$ask6){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s7:search(query:$search7,type:$type,first:$first7,after:$after7) @include(if:$ask7){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s8:search(query:$search8,type:$type,first:$first8,after:$after8) @include(if:$ask8){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s9:search(query:$search9,type:$type,first:$first9,after:$after9) @include(if:$ask9){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s10:search(query:$search10,type:$type,first:$first10,after:$after10) @include(if:$ask10){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s11:search(query:$search11,type:$type,first:$first11,after:$after11) @include(if:$ask11){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s12:search(query:$search12,type:$type,first:$first12,after:$after12) @include(if:$ask12){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s13:search(query:$search13,type:$type,first:$first13,after:$after13) @include(if:$ask13){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s14:search(query:$search14,type:$type,first:$first14,after:$after14) @include(if:$ask14){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s15:search(query:$search15,type:$type,first:$first15,after:$after15) @include(if:$ask15){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s16:search(query:$search16,type:$type,first:$first16,after:$after16) @include(if:$ask16){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s17:search(query:$search17,type:$type,first:$first17,after:$after17) @include(if:$ask17){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s18:search(query:$search18,type:$type,first:$first18,after:$after18) @include(if:$ask18){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      s19:search(query:$search19,type:$type,first:$first19,after:$after19) @include(if:$ask19){pageInfo{hasNextPage endCursor} nodes{__typename ... on Issue{id number title state updatedAt repository{nameWithOwner}}}}\n      o0:repositoryOwner(login:$owner) @include(if:$origin0){... on ProjectV2Owner{projectV2(number:$number){items(first:$itemsFirst0,after:$itemsAfter0,query:$filter0){nodes{id content{__typename ... on Issue{id}}} pageInfo{hasNextPage endCursor}}}}}\n      o1:repositoryOwner(login:$owner) @include(if:$origin1){... on ProjectV2Owner{projectV2(number:$number){items(first:$itemsFirst1,after:$itemsAfter1,query:$filter1){nodes{id content{__typename ... on Issue{id}}} pageInfo{hasNextPage endCursor}}}}}\n      o2:repositoryOwner(login:$owner) @include(if:$origin2){... on ProjectV2Owner{projectV2(number:$number){items(first:$itemsFirst2,after:$itemsAfter2,query:$filter2){nodes{id content{__typename ... on Issue{id}}} pageInfo{hasNextPage endCursor}}}}}\n      o3:repositoryOwner(login:$owner) @include(if:$origin3){... on ProjectV2Owner{projectV2(number:$number){items(first:$itemsFirst3,after:$itemsAfter3,query:$filter3){nodes{id content{__typename ... on Issue{id}}} pageInfo{hasNextPage endCursor}}}}}\n      o4:repositoryOwner(login:$owner) @include(if:$origin4){... on ProjectV2Owner{projectV2(number:$number){items(first:$itemsFirst4,after:$itemsAfter4,query:$filter4){nodes{id content{__typename ... on Issue{id}}} pageInfo{hasNextPage endCursor}}}}}\n    }";
Expand description

Up to SEARCH_BATCH board-scoped issue searches in one request, each SEARCH_ISSUES’s connection in an aliased s<n> field with its own query, page size and cursor, and beside them up to SEARCH_BATCH_ORIGINS origin lookups’ board halves — ORIGIN_LOOKUP’s items filtered by the origin field — in aliased o<n> fields, each origin’s issue search in a search slot of its own.

What task find asks a board, every search a page at a time: one request a round, rather than one per search. A slot not asked is left out by @include, its page size bound to one; GitHub answers an error about one slot at that slot’s path, and the other slots are answered beside it.

It reads which issues match, never the issues themselves. Every row is its scalar fields alone, so GitHub prices each slot as one connection whatever its page size, and a round of twenty searches of a hundred rows each costs one point — where one page of the whole issue fragment cost a point per twenty rows, every row’s labels and board field values priced whether or not that hit was kept. The distinct hits of a whole find are then read once each, DETAIL_BATCH at a time, by ISSUE_DETAILS, which every field a find answers comes from.