@@ -2,7 +2,7 @@ import { CombinedError } from '@urql/core';
22import gql from 'graphql-tag' ;
33
44import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient' ;
5- import { AppPlatform } from '../generated' ;
5+ import { AppPlatform , EmbeddedUpdate } from '../generated' ;
66import { Connection } from '../../utils/relay' ;
77import { withErrorHandlingAsync } from '../client' ;
88
@@ -13,20 +13,24 @@ export function isEmbeddedUpdateNotFoundError(error: unknown): boolean {
1313 ) ;
1414}
1515
16- export type EmbeddedUpdateFragment = {
17- id : string ;
18- platform : AppPlatform ;
19- runtimeVersion : string ;
20- channel : string ;
21- createdAt : string ;
22- } ;
16+ // Query result types are defined manually because the embeddedUpdates query fields
17+ // are not yet included in the GraphQL codegen schema.
18+ export type EmbeddedUpdateFragment = Pick <
19+ EmbeddedUpdate ,
20+ 'id' | 'platform' | 'runtimeVersion' | 'channel' | 'createdAt'
21+ > ;
2322
2423type ViewEmbeddedUpdateByIdQueryResult = {
2524 embeddedUpdates : {
2625 byId : EmbeddedUpdateFragment ;
2726 } ;
2827} ;
2928
29+ type ViewEmbeddedUpdateByIdQueryVariables = {
30+ embeddedUpdateId : string ;
31+ appId : string ;
32+ } ;
33+
3034type ViewEmbeddedUpdatesPaginatedQueryResult = {
3135 app : {
3236 byId : {
@@ -43,6 +47,13 @@ type ViewEmbeddedUpdatesPaginatedQueryResult = {
4347 } ;
4448} ;
4549
50+ type ViewEmbeddedUpdatesPaginatedQueryVariables = {
51+ appId : string ;
52+ first : number ;
53+ after ?: string ;
54+ filter ?: EmbeddedUpdateFilter ;
55+ } ;
56+
4657export type EmbeddedUpdateFilter = {
4758 platform ?: AppPlatform ;
4859 runtimeVersion ?: string ;
@@ -56,7 +67,7 @@ export const EmbeddedUpdateQuery = {
5667 ) : Promise < EmbeddedUpdateFragment > {
5768 const data = await withErrorHandlingAsync (
5869 graphqlClient
59- . query < ViewEmbeddedUpdateByIdQueryResult > (
70+ . query < ViewEmbeddedUpdateByIdQueryResult , ViewEmbeddedUpdateByIdQueryVariables > (
6071 gql `
6172 query ViewEmbeddedUpdateById($embeddedUpdateId: ID!, $appId: ID!) {
6273 embeddedUpdates {
@@ -94,7 +105,7 @@ export const EmbeddedUpdateQuery = {
94105 ) : Promise < Connection < EmbeddedUpdateFragment > > {
95106 const data = await withErrorHandlingAsync (
96107 graphqlClient
97- . query < ViewEmbeddedUpdatesPaginatedQueryResult > (
108+ . query < ViewEmbeddedUpdatesPaginatedQueryResult , ViewEmbeddedUpdatesPaginatedQueryVariables > (
98109 gql `
99110 query ViewEmbeddedUpdatesPaginated(
100111 $appId: String!
0 commit comments