Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
fix: remove indent from generated query
Browse files Browse the repository at this point in the history
  • Loading branch information
RinkiyaKeDad authored Sep 30, 2020
1 parent 72b64eb commit 2f8bb07
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 103 deletions.
19 changes: 8 additions & 11 deletions packages/graphback-codegen-client/src/templates/gqlTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const fragment = (t: GraphQLObjectType) => {

return `fragment ${t.name}Fields on ${t.name} {
${returnFieldsString}
} `
}`
}

export const expandedFragment = (t: GraphQLObjectType) => {
Expand All @@ -18,7 +18,7 @@ export const expandedFragment = (t: GraphQLObjectType) => {

return `fragment ${t.name}ExpandedFields on ${t.name} {
${returnFieldsString}
} `
}`
}

export const findOneQuery = (t: ModelDefinition) => {
Expand All @@ -28,7 +28,7 @@ export const findOneQuery = (t: ModelDefinition) => {
${fieldName}(id: $id) {
...${t.graphqlType.name}ExpandedFields
}
}`
}`
}

export const findQuery = (t: GraphQLObjectType) => {
Expand All @@ -44,7 +44,7 @@ export const findQuery = (t: GraphQLObjectType) => {
limit
count
}
}`
}`
}


Expand All @@ -56,8 +56,7 @@ export const createMutation = (t: GraphQLObjectType) => {
${ fieldName}(input: $input) {
...${ t.name}Fields
}
}
`
}`
}

export const updateMutation = (t: GraphQLObjectType) => {
Expand All @@ -68,8 +67,7 @@ export const updateMutation = (t: GraphQLObjectType) => {
${fieldName}(input: $input) {
...${ t.name}Fields
}
}
`
}`
}

export const deleteMutation = (t: GraphQLObjectType) => {
Expand All @@ -80,8 +78,7 @@ export const deleteMutation = (t: GraphQLObjectType) => {
${fieldName}(input: $input) {
...${t.name}Fields
}
}
`
}`
}

export const subscription = (t: GraphQLObjectType, fieldName: string, inputTypeField: string) => {
Expand All @@ -90,7 +87,7 @@ export const subscription = (t: GraphQLObjectType, fieldName: string, inputTypeF
${fieldName}(filter: $filter) {
...${t.name}Fields
}
} `
}`
}

export const createFragments = (types: ModelDefinition[]) => {
Expand Down
Loading

0 comments on commit 2f8bb07

Please sign in to comment.