4
0
forked from crowetic/commerce
2020-10-03 16:06:41 -05:00

21 lines
450 B
TypeScript

export interface CommerceAPIConfig {
commerceUrl: string
apiToken: string
cartCookie: string
fetch<Q, V = any>(
query: string,
queryData?: CommerceAPIFetchOptions<V>
): Promise<Q>
}
export interface CommerceAPIFetchOptions<V> {
variables?: V
preview?: boolean
}
// TODO: define interfaces for all the available operations
// export interface CommerceAPI {
// getAllProducts(options?: { query: string }): Promise<any>;
// }