Add GQL fragments

pull/1/head
Max Ehrlicher-Schmidt 4 years ago
parent 2922345a60
commit c7053ac0c7

@ -1,13 +1,15 @@
overwrite: true
wtach: true
schema: "http://localhost:4000/graphql"
documents: "src/app/graphqlOperations/*"
documents: "src/app/graphqlOperations/**/*"
generates:
src/generated/graphql.ts:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-apollo-angular"
config:
immutableTypes: false
./graphql.schema.json:
plugins:
- "introspection"

@ -0,0 +1,5 @@
query GetCargoBikeById($id: ID!){
cargoBikeById(id: $id) {
...CargoBikeFragment
}
}

@ -1,40 +1,5 @@
query GetCargoBikes{
cargoBikes {
id
group
name
events {
date
}
insuranceData {
billing
}
dimensionsAndLoad {
bikeLength
bikeWeight
}
numberOfChildren
security {
frameNumber
adfcCoding
keyNumberAXAChain
keyNumberFrameLock
policeCoding
}
dimensionsAndLoad {
bikeHeight
bikeLength
bikeWeight
bikeWidth
boxHeight
boxLength
boxWidth
hasCoverBox
lockable
maxWeightBox
maxWeightLuggageRack
maxWeightTotal
}
...CargoBikeFragment
}
}

@ -0,0 +1,38 @@
fragment CargoBikeFragment on CargoBike {
id
group
name
events {
date
}
insuranceData {
billing
}
dimensionsAndLoad {
bikeLength
bikeWeight
}
numberOfChildren
security {
frameNumber
adfcCoding
keyNumberAXAChain
keyNumberFrameLock
policeCoding
}
dimensionsAndLoad {
bikeHeight
bikeLength
bikeWeight
bikeWidth
boxHeight
boxLength
boxWidth
hasCoverBox
lockable
maxWeightBox
maxWeightLuggageRack
maxWeightTotal
}
}

@ -657,6 +657,19 @@ export enum CacheControlScope {
}
export type GetCargoBikeByIdQueryVariables = Exact<{
id: Scalars['ID'];
}>;
export type GetCargoBikeByIdQuery = (
{ __typename?: 'Query' }
& { cargoBikeById?: Maybe<(
{ __typename?: 'CargoBike' }
& CargoBikeFragmentFragment
)> }
);
export type GetCargoBikesQueryVariables = Exact<{ [key: string]: never; }>;
@ -664,7 +677,13 @@ export type GetCargoBikesQuery = (
{ __typename?: 'Query' }
& { cargoBikes: Array<Maybe<(
{ __typename?: 'CargoBike' }
& Pick<CargoBike, 'id' | 'name' | 'numberOfChildren'>
& CargoBikeFragmentFragment
)>> }
);
export type CargoBikeFragmentFragment = (
{ __typename?: 'CargoBike' }
& Pick<CargoBike, 'id' | 'group' | 'name' | 'numberOfChildren'>
& { events?: Maybe<Array<Maybe<(
{ __typename?: 'BikeEvent' }
& Pick<BikeEvent, 'date'>
@ -676,15 +695,14 @@ export type GetCargoBikesQuery = (
& Pick<DimensionsAndLoad, 'bikeLength' | 'bikeWeight' | 'bikeHeight' | 'bikeWidth' | 'boxHeight' | 'boxLength' | 'boxWidth' | 'hasCoverBox' | 'lockable' | 'maxWeightBox' | 'maxWeightLuggageRack' | 'maxWeightTotal'>
), security: (
{ __typename?: 'Security' }
& Pick<Security, 'frameNumber'>
& Pick<Security, 'frameNumber' | 'adfcCoding' | 'keyNumberAXAChain' | 'keyNumberFrameLock' | 'policeCoding'>
) }
)>> }
);
export const GetCargoBikesDocument = gql`
query GetCargoBikes {
cargoBikes {
export const CargoBikeFragmentFragmentDoc = gql`
fragment CargoBikeFragment on CargoBike {
id
group
name
events {
date
@ -709,6 +727,10 @@ export const GetCargoBikesDocument = gql`
numberOfChildren
security {
frameNumber
adfcCoding
keyNumberAXAChain
keyNumberFrameLock
policeCoding
}
dimensionsAndLoad {
bikeHeight
@ -724,9 +746,33 @@ export const GetCargoBikesDocument = gql`
maxWeightLuggageRack
maxWeightTotal
}
}
}
`;
export const GetCargoBikeByIdDocument = gql`
query GetCargoBikeById($id: ID!) {
cargoBikeById(id: $id) {
...CargoBikeFragment
}
}
${CargoBikeFragmentFragmentDoc}`;
@Injectable({
providedIn: 'root'
})
export class GetCargoBikeByIdGQL extends Apollo.Query<GetCargoBikeByIdQuery, GetCargoBikeByIdQueryVariables> {
document = GetCargoBikeByIdDocument;
constructor(apollo: Apollo.Apollo) {
super(apollo);
}
}
export const GetCargoBikesDocument = gql`
query GetCargoBikes {
cargoBikes {
...CargoBikeFragment
}
}
${CargoBikeFragmentFragmentDoc}`;
@Injectable({
providedIn: 'root'

Loading…
Cancel
Save