Created
August 18, 2020 16:52
-
-
Save alexFaunt/01915bf50ee9633e39d6883d1e58b83d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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