export function applyPartial<T>(state: T, patch: Partial<T>, skipKeys: (keyof T)[] = []) {
  for (const key in patch) {
    if (!skipKeys.includes(key as keyof T) && patch[key] !== undefined) {
      state[key as keyof T] = patch[key]!;
    }
  }
}

export type GraphQLResponse<T extends string, EntityList> = {
  data: {
    [key in T]: EntityList;
  };
  errors: unknown[];
};
