Why data is optional?

Hello guys!

For sake of type compability could anybody explain why data property of FetchResult is optional?

export interface FetchResult<TData = {
    [key: string]: any;
}, C = Record<string, any>, E = Record<string, any>> extends ExecutionResult {
    data?: TData | null;
    extensions?: E;
    context?: C;

In which cases it’s possible? And how is it supposed to work with it?

@qodunpob Apollo Client’s FetchResult type mirrors the graphql-js ExecutionResult type:

data has been optional in graphql-js since its inception:

Are you running into a specific issue because of this?

Oh, thank you, that slightly explains. But it is still not clear under what situations this can happen and how to work with it in “strict” mode. I mean in “strict” mode you have to take care about handling optional state.