Merge pull request 'Support new feature tables' (#26) from support-new-feature-schema into master
Reviewed-on: billnerds/rn-playground#26 Reviewed-by: Ivan Malison <ivanmalison@gmail.com>
This commit is contained in:
commit
4c1bd21f3d
1
App.tsx
1
App.tsx
@ -6,6 +6,7 @@ import ShotsContainer from "./component/shot";
|
||||
const App: React.FC = () => {
|
||||
return (
|
||||
<ClientProvider>
|
||||
<ShotsContainer />
|
||||
<Text>test</Text>
|
||||
</ClientProvider>
|
||||
);
|
||||
|
@ -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<Props> = ({ 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]),
|
||||
|
@ -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)
|
||||
}
|
||||
`;
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user