Skip to content
Merged
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
19 changes: 18 additions & 1 deletion packages/apollo/src/commands/queries/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ export default class RegisterQueries extends Command {
description:
"Automatically remove @client and @connection directives and fields from operations"
}),
// XXX abstract for "clientFlags" and add to config
clientIdentifier: flags.string({
description:
"Identifier for the client which will match ids from client traces, will use clientName if not provided"
}),
clientName: flags.string({
required: true,
description: "Name of the client that the queries will be attached to"
}),
clientVersion: flags.string({
description:
"The version of the client that the queries will be attached to"
}),
...engineFlags,

tagName: flags.string({
Expand Down Expand Up @@ -96,7 +109,11 @@ export default class RegisterQueries extends Command {
}

const variables = {
clientName: "TODO Client",
clientIdentity: {
clientName: flags.clientName,
clientIdentifier: flags.clientIdentifier || flags.clientName,
clientVersion: flags.clientVersion
},
serviceId: getIdFromKey(ctx.currentSchema.engineKey),
operations: ctx.manifest.operations
};
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo/src/operations/registerOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import gql from "graphql-tag";
export const REGISTER_OPERATIONS = gql`
mutation RegisterOperations(
$serviceId: ID!
$clientName: String!
$clientIdentity: RegisteredClientIdentityInput!
$operations: [RegisteredOperationInput!]!
) {
service(id: $serviceId) {
Expand Down