menu

Saleor Commerce

The world’s fastest growing open-source e-commerce platform with billions of dollars transacted. Powered by Python, GraphQL, ReactJS and PWA.

Channels
# All channels
view-forward
# General
view-forward
# Announcements
view-forward
# Design
view-forward
# Development
view-forward
# Saleor Features
view-forward
Team

Using TypedQuery with zero TypedVariables

May 27, 2020 at 1:31am

Using TypedQuery with zero TypedVariables

May 27, 2020 at 1:31am (Edited 2 months ago)
I have a Subscription model where User is a foreign key. I want to query all subscriptions of a user. Since user is already included in the jwt token, when I make a query I dont have any variables to send.
My query is :
export const userSubscriptionsQuery = gql`
query GetUserSubscriptions(
) {
subscriptions {
edges {
node {
...BasicSubscriptionFields
}
}
}
`;
export const TypedUserSubscriptionsQuery = TypedQuery<
BasicSubscriptionFields,
null
>(userSubscriptionsQuery);
This is throwing me an error. Can anyone please suggest the right way of doing this?
No messages yet