Add GQL fragments

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

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

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

@ -1,40 +1,5 @@
query GetCargoBikes{ query GetCargoBikes{
cargoBikes { cargoBikes {
id ...CargoBikeFragment
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
}
} }
} }

@ -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; }>; export type GetCargoBikesQueryVariables = Exact<{ [key: string]: never; }>;
@ -664,7 +677,13 @@ export type GetCargoBikesQuery = (
{ __typename?: 'Query' } { __typename?: 'Query' }
& { cargoBikes: Array<Maybe<( & { cargoBikes: Array<Maybe<(
{ __typename?: 'CargoBike' } { __typename?: 'CargoBike' }
& Pick<CargoBike, 'id' | 'name' | 'numberOfChildren'> & CargoBikeFragmentFragment
)>> }
);
export type CargoBikeFragmentFragment = (
{ __typename?: 'CargoBike' }
& Pick<CargoBike, 'id' | 'group' | 'name' | 'numberOfChildren'>
& { events?: Maybe<Array<Maybe<( & { events?: Maybe<Array<Maybe<(
{ __typename?: 'BikeEvent' } { __typename?: 'BikeEvent' }
& Pick<BikeEvent, 'date'> & Pick<BikeEvent, 'date'>
@ -676,15 +695,14 @@ export type GetCargoBikesQuery = (
& Pick<DimensionsAndLoad, 'bikeLength' | 'bikeWeight' | 'bikeHeight' | 'bikeWidth' | 'boxHeight' | 'boxLength' | 'boxWidth' | 'hasCoverBox' | 'lockable' | 'maxWeightBox' | 'maxWeightLuggageRack' | 'maxWeightTotal'> & Pick<DimensionsAndLoad, 'bikeLength' | 'bikeWeight' | 'bikeHeight' | 'bikeWidth' | 'boxHeight' | 'boxLength' | 'boxWidth' | 'hasCoverBox' | 'lockable' | 'maxWeightBox' | 'maxWeightLuggageRack' | 'maxWeightTotal'>
), security: ( ), security: (
{ __typename?: 'Security' } { __typename?: 'Security' }
& Pick<Security, 'frameNumber'> & Pick<Security, 'frameNumber' | 'adfcCoding' | 'keyNumberAXAChain' | 'keyNumberFrameLock' | 'policeCoding'>
) } ) }
)>> }
); );
export const GetCargoBikesDocument = gql` export const CargoBikeFragmentFragmentDoc = gql`
query GetCargoBikes { fragment CargoBikeFragment on CargoBike {
cargoBikes {
id id
group
name name
events { events {
date date
@ -709,6 +727,10 @@ export const GetCargoBikesDocument = gql`
numberOfChildren numberOfChildren
security { security {
frameNumber frameNumber
adfcCoding
keyNumberAXAChain
keyNumberFrameLock
policeCoding
} }
dimensionsAndLoad { dimensionsAndLoad {
bikeHeight bikeHeight
@ -724,9 +746,33 @@ export const GetCargoBikesDocument = gql`
maxWeightLuggageRack maxWeightLuggageRack
maxWeightTotal 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({ @Injectable({
providedIn: 'root' providedIn: 'root'

Loading…
Cancel
Save