Slicemachine People! We need your opinion!
Hey guys, as you all know, we're close to supporting variations for Shared Slices in Slicemachine.
We also want to support GraphQL and that's something we're currently working on, but we have something needs your attention and input.
We have a dilemma on graphQL (and graphQuery) in term of syntax for shared slices:
There are 3 solutions
- Make it flat, but it can get messy since you need to specify all the fields of all the variations in the same spot
query {
allPages {
edges {
node {
body {
... on MySharedSlice {
variation
primary
items
}
}
}
}
}
}
- Switch on variations inside a slice: that one is the perfect representation of what is actually going on but it makes it huge to build
query {
allPages {
edges {
node {
body {
... on MySharedSlice {
variation {
... on Variation1 {
primary
items
}
... on Variation2 {
primary
items
}
}
}
... on MySlice2 {
primary
items
}
}
}
}
}
}
- Merge Slices and SharedSlices + Variation on the same level to make it look simple even though there are as many cases
query {
allPages {
edges {
node {
body {
... on MySharedSlice_Variation1 {
primary
items
}
... on MySharedSlice_Variation2 {
primary
items
}
... on MySlice2 {
primary
items
}
}
}
}
}
}
What do you think would be best and easiest to understand?
Thanks.