Skip to content

Instantly share code, notes, and snippets.

@alexFaunt
Created August 18, 2020 16:52
Show Gist options
  • Save alexFaunt/01915bf50ee9633e39d6883d1e58b83d to your computer and use it in GitHub Desktop.
Save alexFaunt/01915bf50ee9633e39d6883d1e58b83d to your computer and use it in GitHub Desktop.
query1 = `
mutation {
startStreamableWorkout(input: { exerciseSchemaVersion: 1.0 }) {
workout {
exerciseSchema {
version
schema
}
}
}
}
`;
result1 = {
startStreamableWorkout: {
workout: {
exerciseSchema: {
version: '1.0',
schema: { ...schema data }
}
}
}
};
... Do half a workout - app crashed
... reload app - query the in progress workout from the store
query2 = `
query {
workoutById(id: 1) {
exerciseSchema {
version
schema
}
}
}
`;
result2 = ~ result1;
... resume the workout
... I guess this does not work if between query1 and query2 you changed schema version...?
... Perhaps in that edge case just check workout.exerciseSchema.version = current version -> reject and say you can't resume
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment