Is there a way to concat two string values in a gatsby graphql query.
Example:
query myQuery($uid: String!) {
page: prismicBlock(uid: { eq: $uid }) {
uid
data {
body {
__typename
... on PrismicBlockBodySlice {
slice_type
primary {
valueA
valueB
}
}
}
}
}
}
Is there way to concat valueA and valueB into one value ?
No. GraphQL doesn't have any sort of value-manipulation functions; even the "eq" syntax you show in your query is application-specific.
If you had full control over the server and its implementation, and you thought this was an operation that would be performed frequently, you could write a custom valuesAandB field whose resolver function concatenated the two. Usually you'd just wind up doing this on the client side, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With