0

I am working on graphql-codegen I have this graphql query

export const QUERY=gql`
query fetchView($workId: String!, $dataType: String, $lockedDTO: LockedDTOInput!) 
{ fetchView (workId: $workId) {
    id
    

}
}`;

any my resulting query is

export type fetchworkQuery = { __typename?: 'Query', fetchWork: { __typename?: 'Calendar', id: string | null } | { __typename?: 'Filtered', id: string | null } | { __typename?: 'Filteredtime', id: string | null } | { __typename?: 'lossen', id: string | null } | { __typename?: 'SpreadSheet', id: string | null } | { __typename?: 'Timeview', id: string | null } | null };

these Calendar,Filtered, Filteredtime, lossen, Spreadsheet and Timeview are the implementations of record. I want the resulting output to be

export type fetchworkQuery = { fetchWork: { id: string | null } | null };

Can someone help me out?

I want to generate a specific type of query in which the data type of fetchworkQuery should be not dependent of the implementations it has.

rahul
  • 1

0 Answers0