Skip to content

TS QueryResponseInitial sourceMap optional #76

@dvnrsn

Description

@dvnrsn

This happens on useQuery's initial

const {data, loading} = useQuery<HomePage>(
    QUERY,
    undefined,
    {initial},
);
Property 'sourceMap' is optional in type 'JsonifyObject<QueryResponseInitial<HomePage>>' 
but required in type 'QueryResponseInitial<HomePage>'
export declare interface QueryResponseInitial<QueryResponseResult> {
  data: QueryResponseResult
  sourceMap: ContentSourceMap | undefined

I believe this is because JsonifyObject cannot accept undefined. If I remove undefined, TS is satisfied

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions