Hi All,
I have to fetch data from the api with graphql query by passing the dynamic arguments. But not sure How to get the data using arguments.
here is my query:
import { gql, useQuery } from “@apollo/client”;
export const SORT_DATA = gql`
query getAssetResourceListing($first: Int, $after: Int, $sortBy: [String], $sortOrder: [String]) {
getAssetResourceListing(first:$first, after:$after, sortBy:$sortBy, sortOrder:$sortOrder){
edges {
node {
Name
creationDate
modificationDate
Asset {
… on asset {
assetThumb: fullpath(thumbnail: “poc_thumbnail”)
}
}
AssetType {
… on object_AssetType {Name}
}
Product {
SKU_name:SKU
}
Project {
Name
}
}
}
}
}
`;
please help me to get the data with argumenst.