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

Usage reporting: report referenced fields in addition to executed fields #5956

Merged
merged 6 commits into from
Dec 17, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The version headers in this history reflect the versions of Apollo Server itself
## vNEXT (minor!)

- `apollo-server-core`: Usage reporting no longer sends a "client reference ID" to Apollo Studio (along with the client name and client version). This little-used feature has not been documented [since 2019](https://github.com/apollographql/apollo-server/pull/3180) and is currently entirely ignored by Apollo Studio. This is technically incompatible as the interface `ClientInfo` no longer has the field `clientReferenceId`; if you were one of the few users who explicitly set this field and you get a TypeScript compilation failure upon upgrading to v3.6.0, just stop using the field. [PR #5890](https://github.com/apollographql/apollo-server/pull/5890)
- `apollo-server-core`: Preliminary support for referenced field reporting. THIS ENTRY NEEDS TO BE EXPANDED BEFORE THE v3.6.0 RELEASE. [Issue #5708](https://github.com/apollographql/apollo-server/issues/5708) [PR #5956](https://github.com/apollographql/apollo-server/pull/5956)
- `apollo-server-core`: Remove dependency on `apollo-graphql` package (by inlining the code which generates usage reporting signatures). That package has not yet been published with a `graphql@16` peer dependency, so Apollo Server v3.5 did not fully support `graphql@16` without overriding peer dependencies. [Issue #5941](https://github.com/apollographql/apollo-server/issues/5941) [PR #5955](https://github.com/apollographql/apollo-server/pull/5955)

## v3.5.0
Expand Down
169 changes: 40 additions & 129 deletions packages/apollo-reporting-protobuf/generated/protobuf.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ export interface ITrace {
/** Trace clientVersion */
clientVersion?: (string|null);

/** Trace clientAddress */
clientAddress?: (string|null);

/** Trace http */
http?: (Trace.IHTTP|null);

Expand Down Expand Up @@ -99,9 +96,6 @@ export class Trace implements ITrace {
/** Trace clientVersion. */
public clientVersion: string;

/** Trace clientAddress. */
public clientAddress: string;

/** Trace http. */
public http?: (Trace.IHTTP|null);

Expand Down Expand Up @@ -2323,179 +2317,90 @@ export class TypeStat implements ITypeStat {
public toJSON(): { [k: string]: any };
}

/** Properties of a Field. */
export interface IField {
/** Properties of a ReferencedFieldsForType. */
export interface IReferencedFieldsForType {

/** Field name */
name?: (string|null);
/** ReferencedFieldsForType fieldNames */
fieldNames?: (string[]|null);

/** Field returnType */
returnType?: (string|null);
/** ReferencedFieldsForType isInterface */
isInterface?: (boolean|null);
}

/** Represents a Field. */
export class Field implements IField {
/** Represents a ReferencedFieldsForType. */
export class ReferencedFieldsForType implements IReferencedFieldsForType {

/**
* Constructs a new Field.
* Constructs a new ReferencedFieldsForType.
* @param [properties] Properties to set
*/
constructor(properties?: IField);
constructor(properties?: IReferencedFieldsForType);

/** Field name. */
public name: string;
/** ReferencedFieldsForType fieldNames. */
public fieldNames: string[];

/** Field returnType. */
public returnType: string;
/** ReferencedFieldsForType isInterface. */
public isInterface: boolean;

/**
* Creates a new Field instance using the specified properties.
* Creates a new ReferencedFieldsForType instance using the specified properties.
* @param [properties] Properties to set
* @returns Field instance
* @returns ReferencedFieldsForType instance
*/
public static create(properties?: IField): Field;
public static create(properties?: IReferencedFieldsForType): ReferencedFieldsForType;

/**
* Encodes the specified Field message. Does not implicitly {@link Field.verify|verify} messages.
* @param message Field message or plain object to encode
* Encodes the specified ReferencedFieldsForType message. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages.
* @param message ReferencedFieldsForType message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: IField, writer?: $protobuf.Writer): $protobuf.Writer;
public static encode(message: IReferencedFieldsForType, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified Field message, length delimited. Does not implicitly {@link Field.verify|verify} messages.
* @param message Field message or plain object to encode
* Encodes the specified ReferencedFieldsForType message, length delimited. Does not implicitly {@link ReferencedFieldsForType.verify|verify} messages.
* @param message ReferencedFieldsForType message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: IField, writer?: $protobuf.Writer): $protobuf.Writer;
public static encodeDelimited(message: IReferencedFieldsForType, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes a Field message from the specified reader or buffer.
* Decodes a ReferencedFieldsForType message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Field
* @returns ReferencedFieldsForType
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Field;
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ReferencedFieldsForType;

/**
* Decodes a Field message from the specified reader or buffer, length delimited.
* Decodes a ReferencedFieldsForType message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Field
* @returns ReferencedFieldsForType
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Field;
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ReferencedFieldsForType;

/**
* Verifies a Field message.
* Verifies a ReferencedFieldsForType message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);

/**
* Creates a plain object from a Field message. Also converts values to other types if specified.
* @param message Field
* Creates a plain object from a ReferencedFieldsForType message. Also converts values to other types if specified.
* @param message ReferencedFieldsForType
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: Field, options?: $protobuf.IConversionOptions): { [k: string]: any };
public static toObject(message: ReferencedFieldsForType, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
* Converts this Field to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}

/** Properties of a Type. */
export interface IType {

/** Type name */
name?: (string|null);

/** Type field */
field?: (IField[]|null);
}

/** Represents a Type. */
export class Type implements IType {

/**
* Constructs a new Type.
* @param [properties] Properties to set
*/
constructor(properties?: IType);

/** Type name. */
public name: string;

/** Type field. */
public field: IField[];

/**
* Creates a new Type instance using the specified properties.
* @param [properties] Properties to set
* @returns Type instance
*/
public static create(properties?: IType): Type;

/**
* Encodes the specified Type message. Does not implicitly {@link Type.verify|verify} messages.
* @param message Type message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: IType, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified Type message, length delimited. Does not implicitly {@link Type.verify|verify} messages.
* @param message Type message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: IType, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes a Type message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Type
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Type;

/**
* Decodes a Type message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Type
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Type;

/**
* Verifies a Type message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);

/**
* Creates a plain object from a Type message. Also converts values to other types if specified.
* @param message Type
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: Type, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
* Converts this Type to JSON.
* Converts this ReferencedFieldsForType to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
Expand Down Expand Up @@ -2700,6 +2605,9 @@ export interface ITracesAndStats {
/** TracesAndStats statsWithContext */
statsWithContext?: ($protobuf.ToArray<IContextualizedStats>|IContextualizedStats[]|null);

/** TracesAndStats referencedFieldsByType */
referencedFieldsByType?: ({ [k: string]: IReferencedFieldsForType }|null);

/** TracesAndStats internalTracesContributingToStats */
internalTracesContributingToStats?: ((ITrace|Uint8Array)[]|null);
}
Expand All @@ -2719,6 +2627,9 @@ export class TracesAndStats implements ITracesAndStats {
/** TracesAndStats statsWithContext. */
public statsWithContext: IContextualizedStats[];

/** TracesAndStats referencedFieldsByType. */
public referencedFieldsByType: { [k: string]: IReferencedFieldsForType };

/** TracesAndStats internalTracesContributingToStats. */
public internalTracesContributingToStats: (ITrace|Uint8Array)[];

Expand Down
Loading