Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gql tag to software fragment on AppEnvironmentSoftwareSettingsSoftware #1808

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ used.
dependencies without updating `package.json`
3. Run `npm run typescript:codegen:generate` - this will regenerate the types.

#### Throubleshooting

- You might encounter an error message saying GraphQL Document Validation failed with 4 errors;
Error 0: Unknown fragment "Software". - This is because the codegen script is looking for fragments in the schema.
You can skip this by adding the tag `gql` in the const appQueryFragments declaration (`export const appQueryFragments = gql(...)`.

## Alerting

There are no alerts.
34 changes: 19 additions & 15 deletions src/lib/config/software.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,31 @@ export const appQuery = `
}
}`;

export const appQueryFragments = `fragment Software on AppEnvironmentSoftwareSettingsSoftware {
// $FlowFixMe: gql template is not supported by flow
// This causes a GraphQL Document Validation failure in the codegen.ts file
// To fix this, we need to add the tag to the gql template
export const appQueryFragments = `
fragment Software on AppEnvironmentSoftwareSettingsSoftware {
name
slug
pinned
current {
version
default
deprecated
unstable
compatible
latestRelease
private
version
default
deprecated
unstable
compatible
latestRelease
private
}
options {
version
default
deprecated
unstable
compatible
latestRelease
private
version
default
deprecated
unstable
compatible
latestRelease
private
}
}
`;
Expand Down