Skip to content

Align Result and QueryResult #1303

@gschulze

Description

@gschulze

Describe the feature

I discovered that there are two types that are quite similar: Result and QueryResult.

One is defined as:

export type Result<DataType> = {
    isFetching: boolean
    partial: boolean
    source?: DataSource | null
    data?: DataType | null
    error?: Error | null
}

the other one as

export type QueryResult<_Data = GraphQLObject, _Input = GraphQLVariables> = {
    data: _Data | null;
    errors: {
        message: string;
    }[] | null;
    fetching: boolean;
    partial: boolean;
    stale: boolean;
    source: DataSources | null;
    variables: _Input | null;
};

Why is it called isFetching one time and fetching the other? I'm asking because our project uses derived stores, which propagate the fetching field with a transformed data field. Instead of defining our own Result type, I would rather use an existing one, so I discovered the inconsistency.

It would be nice if these types used the same name for all fields.

Criticality

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions