diff --git a/App.tsx b/App.tsx index 35eb57c..6a47ac6 100644 --- a/App.tsx +++ b/App.tsx @@ -6,6 +6,7 @@ import ShotsContainer from "./component/shot"; const App: React.FC = () => { return ( + test ); diff --git a/graphql/client.tsx b/graphql/client.tsx index a5c4a1c..6d271a4 100644 --- a/graphql/client.tsx +++ b/graphql/client.tsx @@ -7,8 +7,6 @@ import { from, } from "@apollo/client"; import { API_URI } from "@env"; -import { SHOT_FEATURES_FRAGMENT } from "./fragment/shot"; -import { createFragmentRegistry } from "@apollo/client/cache"; type Props = { children: ReactNode; @@ -18,9 +16,7 @@ const ClientProvider: React.FC = ({ children }) => { const httpLink = new HttpLink({ uri: API_URI, }); - const cache = new InMemoryCache({ - fragments: createFragmentRegistry(SHOT_FEATURES_FRAGMENT), - }); + const cache = new InMemoryCache({}); const client = new ApolloClient({ link: from([httpLink]), diff --git a/graphql/fragment/shot.ts b/graphql/fragment/shot.ts deleted file mode 100644 index 9412514..0000000 --- a/graphql/fragment/shot.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { gql } from "@apollo/client"; - -export const SHOT_FEATURES_FRAGMENT = gql` - fragment ShotFeatures on ShotFeaturesGQL { - cueObjectDistance @include(if: $includeCueObjectDistance) - targetPocketDistance @include(if: $includeTargetPocketDistance) - cueObjectAngle @include(if: $includeCueObjectAngle) - cueBallSpeed @include(if: $includeCueBallSpeed) - intendedPocket @include(if: $includeIntendedPocket) - shotDirection @include(if: $includeShotDirection) - didMake @include(if: $includeDidMake) - } -`; diff --git a/graphql/query.ts b/graphql/query.ts index 7a06588..17dedef 100644 --- a/graphql/query.ts +++ b/graphql/query.ts @@ -4,12 +4,12 @@ export const GET_SHOTS = gql` query GetShots( $filterInput: FilterInput $includeCueObjectDistance: Boolean! = false - $includeTargetPocketDistance: Boolean! = false $includeCueObjectAngle: Boolean! = false $includeCueBallSpeed: Boolean! = false - $includeIntendedPocket: Boolean! = false $includeShotDirection: Boolean! = false - $includeDidMake: Boolean! = false + $includeTargetPocketDistance: Boolean! = false + $includeMake: Boolean! = false + $includeIntendedPocketType: Boolean! = false ) { getShots(filterInput: $filterInput) { id @@ -18,8 +18,16 @@ export const GET_SHOTS = gql` endFrame createdAt updatedAt - features { - ...ShotFeatures + cueObjectFeatures { + cueObjectDistance @include(if: $includeCueObjectDistance) + cueObjectAngle @include(if: $includeCueObjectAngle) + cueBallSpeed @include(if: $includeCueBallSpeed) + shotDirection @include(if: $includeShotDirection) + } + pocketingIntentionFeatures { + targetPocketDistance @include(if: $includeTargetPocketDistance) + make @include(if: $includeMake) + intendedPocketType @include(if: $includeIntendedPocketType) } } }