Skip to content

Commit

Permalink
fix: migrate button should respect namespace (wundergraph#875)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aenimus authored Jun 20, 2024
1 parent 299b4fa commit 46958d6
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 7 deletions.
1 change: 1 addition & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@bufbuild/protobuf": "^1.9.0",
"@connectrpc/connect": "^1.4.0",
"@connectrpc/connect-node": "^1.4.0",
"@graphql-tools/utils": "^10.2.2",
"@wundergraph/composition": "workspace:*",
"@wundergraph/cosmo-connect": "workspace:*",
"@wundergraph/cosmo-shared": "workspace:*",
Expand Down
7 changes: 4 additions & 3 deletions cli/src/commands/router/commands/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { existsSync } from 'node:fs';
import { readFile, writeFile } from 'node:fs/promises';
import { buildRouterConfig, normalizeURL } from '@wundergraph/cosmo-shared';
import { Command, program } from 'commander';
import { parse, printSchema } from 'graphql';
import { parse } from 'graphql';
import * as yaml from 'js-yaml';
import { dirname, resolve } from 'pathe';
import pc from 'picocolors';
import { printSchemaWithDirectives } from '@graphql-tools/utils';
import { BaseCommandOptions } from '../../../core/types/types.js';
import { composeSubgraphs, introspectSubgraph } from '../../../utils.js';

Expand Down Expand Up @@ -94,11 +95,11 @@ export default (opts: BaseCommandOptions) => {
}

const federatedClientSDL = result.federationResult.shouldIncludeClientSchema
? printSchema(result.federationResult.federatedGraphSchema)
? printSchemaWithDirectives(result.federationResult.federatedGraphClientSchema)
: '';
const routerConfig = buildRouterConfig({
federatedClientSDL,
federatedSDL: printSchema(result.federationResult.federatedGraphSchema),
federatedSDL: printSchemaWithDirectives(result.federationResult.federatedGraphSchema),
fieldConfigurations: result.federationResult.fieldConfigurations,
schemaVersionId: '',
subgraphs: config.subgraphs.map((s, index) => {
Expand Down
54 changes: 50 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions studio/src/components/federatedgraphs-cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
} from "./ui/tooltip";
import { useToast } from "./ui/use-toast";
import { useMutation } from "@connectrpc/connect-query";
import { GraphContext } from '@/components/layout/graph-layout';

// this is required to render a blank line with LineChart
const fallbackData = [
Expand Down Expand Up @@ -121,6 +122,7 @@ const MigrationDialog = ({
{
apiKey: data.apiKey,
variantName: data.variantName,
namespace: router.query.namespace as string,
},
{
onSuccess: (d) => {
Expand Down

0 comments on commit 46958d6

Please sign in to comment.