Reputation: 97
Scratching my bald head here. I am building am app using Expo, react native and tsx. I am using Hygraph as my CMS and Apollo Client. The below mutation works well and everything gets stored in the CMS and published.
The problem is that the image gets stored and not published. It says in the draft state. Anyone ever managed to do this successfully?
mutation AddReview(
$businessId: ID!
$userId: String!
$uploadUrl: String!
$userName: String!
$rating: Int!
$comment: String!
) {
createReview(
data: {
business: { connect: { id: $businessId } }
userId: $userId
userName: $userName
userImage: { create: { uploadUrl: $uploadUrl } }
rating: $rating
comment: $comment
}
) {
id
}
publishManyReviewsConnection {
edges {
node {
id
}
}
}
publishManyAssetsConnection {
edges {
node {
id
}
}
}
}
Upvotes: 0
Views: 25
Reputation: 21
If you want to see the data or images in draft mode in your Expo project even if it's not published, just go to the project settings, then to the Content API. There, you can find the content delivery option—just turn it on to "Draft."
Upvotes: 0