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,69 +677,102 @@ export type GetCargoBikesQuery = (
{ __typename?: 'Query' }
& { cargoBikes: Array<Maybe<(
{ __typename?: 'CargoBike' }
& Pick<CargoBike, 'id' | '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'>
) }
& CargoBikeFragmentFragment
)>> }
);
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`
query GetCargoBikes {
cargoBikes {
id
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
}
...CargoBikeFragment
}
}
`;
${CargoBikeFragmentFragmentDoc}`;
@Injectable({
providedIn: 'root'

Loading…
Cancel
Save