Open gouldingken opened 1 year ago
For reference, here are some manually created types:
type SpeckleStreams = {
data: {
streams: {
items: {
id: string
name: string
updatedAt: string
}[]
}
}
}
type SpeckleBranches = {
data: {
stream: {
branches: {
items: SpeckleBranch[]
}
}
}
}
type SpeckleBranch = {
commits: {
items: SpeckleCommit[]
}
}
type SpeckleCommit = {
authorAvatar: string;
authorId: string;
authorName: string;
branchName: string;
createdAt: string;
id: string;
message: string;
referencedObject: string;
sourceApplication: string;
}
Another handy utility if the GraphQL approach is too cumbersome or doesn't work:
To support better type safety (and code hinting) when making API calls, we should replicate the object types that are returned from the server.
It may be possible to use automatic type generation for this: https://www.apollographql.com/docs/apollo-server/workflow/generate-types/