Create shot features fragment

This commit is contained in:
Kat Huang 2024-01-08 22:23:51 -07:00
parent 5192212e0e
commit fcdce8706f
2 changed files with 12 additions and 5 deletions

View File

@ -0,0 +1,10 @@
import { gql } from "@apollo/client";
const SHOT_FEATURES_FRAGMENT = gql`
fragment ShotFeatures on ShotFeaturesGQL {
cueObjectAngle @include(if: $includeCueObjectAngle)
cueObjectDistance @include(if: $includeCueObjectDistance)
}
`;
export default SHOT_FEATURES_FRAGMENT;

View File

@ -1,6 +1,8 @@
import { gql } from "@apollo/client"; import { gql } from "@apollo/client";
import SHOT_FEATURES_FRAGMENT from "./fragment/shot-features";
export const GET_SHOTS = gql` export const GET_SHOTS = gql`
${SHOT_FEATURES_FRAGMENT}
query GetShots( query GetShots(
$includeCueObjectAngle: Boolean! = false $includeCueObjectAngle: Boolean! = false
$includeCueObjectDistance: Boolean! = false $includeCueObjectDistance: Boolean! = false
@ -13,9 +15,4 @@ export const GET_SHOTS = gql`
} }
} }
} }
fragment ShotFeatures on ShotFeaturesGQL {
cueObjectAngle @include(if: $includeCueObjectAngle)
cueObjectDistance @include(if: $includeCueObjectDistance)
}
`; `;