diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index e867e9ae0..bf4f1e0ec 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -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. diff --git a/src/lib/config/software.ts b/src/lib/config/software.ts index 2457f7d9c..a00730e7e 100644 --- a/src/lib/config/software.ts +++ b/src/lib/config/software.ts @@ -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 } } `;