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,69 +677,102 @@ export type GetCargoBikesQuery = (
{ __typename?: 'Query' } { __typename?: 'Query' }
& { cargoBikes: Array<Maybe<( & { cargoBikes: Array<Maybe<(
{ __typename?: 'CargoBike' } { __typename?: 'CargoBike' }
& Pick<CargoBike, 'id' | 'name' | 'numberOfChildren'> & CargoBikeFragmentFragment
& { events?: Maybe<Array<Maybe<(
{ __typename?: 'BikeEvent' }
& Pick<BikeEvent, 'date'>
)>>>, insuranceData: (
{ __typename?: 'InsuranceData' }
& Pick<InsuranceData, 'billing'>
), dimensionsAndLoad: (
{ __typename?: 'DimensionsAndLoad' }
& Pick<DimensionsAndLoad, 'bikeLength' | 'bikeWeight' | 'bikeHeight' | 'bikeWidth' | 'boxHeight' | 'boxLength' | 'boxWidth' | 'hasCoverBox' | 'lockable' | 'maxWeightBox' | 'maxWeightLuggageRack' | 'maxWeightTotal'>
), security: (
{ __typename?: 'Security' }
& Pick<Security, 'frameNumber'>
) }
)>> } )>> }
); );
export type CargoBikeFragmentFragment = (
{ __typename?: 'CargoBike' }
& Pick<CargoBike, 'id' | 'group' | 'name' | 'numberOfChildren'>
& { events?: Maybe<Array<Maybe<(
{ __typename?: 'BikeEvent' }
& Pick<BikeEvent, 'date'>
)>>>, insuranceData: (
{ __typename?: 'InsuranceData' }
& Pick<InsuranceData, 'billing'>
), dimensionsAndLoad: (
{ __typename?: 'DimensionsAndLoad' }
& Pick<DimensionsAndLoad, 'bikeLength' | 'bikeWeight' | 'bikeHeight' | 'bikeWidth' | 'boxHeight' | 'boxLength' | 'boxWidth' | 'hasCoverBox' | 'lockable' | 'maxWeightBox' | 'maxWeightLuggageRack' | 'maxWeightTotal'>
), security: (
{ __typename?: 'Security' }
& Pick<Security, 'frameNumber' | 'adfcCoding' | 'keyNumberAXAChain' | 'keyNumberFrameLock' | 'policeCoding'>
) }
);
export const CargoBikeFragmentFragmentDoc = gql`
fragment CargoBikeFragment on CargoBike {
id
group
name
events {
date
}
insuranceData {
billing
}
dimensionsAndLoad {
bikeLength
bikeWeight
bikeHeight
bikeWidth
boxHeight
boxLength
boxWidth
hasCoverBox
lockable
maxWeightBox
maxWeightLuggageRack
maxWeightTotal
}
numberOfChildren
security {
frameNumber
adfcCoding
keyNumberAXAChain
keyNumberFrameLock
policeCoding
}
dimensionsAndLoad {
bikeHeight
bikeLength
bikeWeight
bikeWidth
boxHeight
boxLength
boxWidth
hasCoverBox
lockable
maxWeightBox
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` export const GetCargoBikesDocument = gql`
query GetCargoBikes { query GetCargoBikes {
cargoBikes { cargoBikes {
id ...CargoBikeFragment
name
events {
date
}
insuranceData {
billing
}
dimensionsAndLoad {
bikeLength
bikeWeight
bikeHeight
bikeWidth
boxHeight
boxLength
boxWidth
hasCoverBox
lockable
maxWeightBox
maxWeightLuggageRack
maxWeightTotal
}
numberOfChildren
security {
frameNumber
}
dimensionsAndLoad {
bikeHeight
bikeLength
bikeWeight
bikeWidth
boxHeight
boxLength
boxWidth
hasCoverBox
lockable
maxWeightBox
maxWeightLuggageRack
maxWeightTotal
}
} }
} }
`; ${CargoBikeFragmentFragmentDoc}`;
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'

Loading…
Cancel
Save