Skip to content

Commit

Permalink
Revert "feat(introspection): add metadata for custom GraphQL operatio…
Browse files Browse the repository at this point in the history
…ns (#771)"

This reverts commit 98b4243.
  • Loading branch information
dpilch committed Apr 1, 2024
1 parent a94649e commit a1b46b1
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 491 deletions.
34 changes: 0 additions & 34 deletions packages/appsync-modelgen-plugin/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ export interface AppSyncModelPluginConfig extends RawDocumentsConfig {
directives?: string;
}

// @public (undocumented)
export type Argument = {
name: string;
type: FieldType;
isArray: boolean;
isRequired: boolean;
isArrayNullable?: boolean;
};

// @public (undocumented)
export type Arguments = Record<string, Argument>;

// @public (undocumented)
export type AssociationBaseType = {
connectionType: CodeGenConnectionType;
Expand Down Expand Up @@ -84,7 +72,6 @@ export type Field = {
isArrayNullable?: boolean;
attributes?: FieldAttribute[];
association?: AssociationType;
arguments?: Arguments;
};

// @public (undocumented)
Expand Down Expand Up @@ -116,9 +103,6 @@ export type ModelIntrospectionSchema = {
models: SchemaModels;
nonModels: SchemaNonModels;
enums: SchemaEnums;
queries?: SchemaQueries;
mutations?: SchemaMutations;
subscriptions?: SchemaSubscriptions;
};

// Warning: (ae-forgotten-export) The symbol "RawAppSyncModelConfig" needs to be exported by the entry point index.d.ts
Expand Down Expand Up @@ -158,12 +142,6 @@ export type SchemaModel = {
// @public (undocumented)
export type SchemaModels = Record<string, SchemaModel>;

// @public (undocumented)
export type SchemaMutation = SchemaQuery;

// @public (undocumented)
export type SchemaMutations = Record<string, SchemaMutation>;

// @public (undocumented)
export type SchemaNonModel = {
name: string;
Expand All @@ -173,18 +151,6 @@ export type SchemaNonModel = {
// @public (undocumented)
export type SchemaNonModels = Record<string, SchemaNonModel>;

// @public (undocumented)
export type SchemaQueries = Record<string, SchemaQuery>;

// @public (undocumented)
export type SchemaQuery = Pick<Field, 'name' | 'type' | 'isArray' | 'isRequired' | 'isArrayNullable' | 'arguments'>;

// @public (undocumented)
export type SchemaSubscription = SchemaQuery;

// @public (undocumented)
export type SchemaSubscriptions = Record<string, SchemaSubscription>;

// @public (undocumented)
export type Target = 'java' | 'swift' | 'javascript' | 'typescript' | 'dart' | 'introspection';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
},
"enums": {
"$ref": "#/definitions/SchemaEnums"
},
"queries": {
"$ref": "#/definitions/SchemaQueries"
},
"mutations": {
"$ref": "#/definitions/SchemaMutations"
},
"subscriptions": {
"$ref": "#/definitions/SchemaSubscriptions"
}
},
"required": [
Expand Down Expand Up @@ -131,9 +122,6 @@
},
"association": {
"$ref": "#/definitions/AssociationType"
},
"arguments": {
"$ref": "#/definitions/Arguments"
}
},
"required": [
Expand Down Expand Up @@ -329,42 +317,6 @@
"targetNames"
]
},
"Arguments": {
"$ref": "#/definitions/Record%3Cstring%2CArgument%3E"
},
"Record<string,Argument>": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"Argument": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"$ref": "#/definitions/FieldType"
},
"isArray": {
"type": "boolean"
},
"isRequired": {
"type": "boolean"
},
"isArrayNullable": {
"type": "boolean"
}
},
"required": [
"name",
"type",
"isArray",
"isRequired"
],
"additionalProperties": false
},
"PrimaryKeyInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -440,72 +392,6 @@
"values"
],
"additionalProperties": false
},
"SchemaQueries": {
"$ref": "#/definitions/Record%3Cstring%2CSchemaQuery%3E"
},
"Record<string,SchemaQuery>": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/SchemaQuery"
}
},
"SchemaQuery": {
"$ref": "#/definitions/Pick%3CField%2C(%22name%22%7C%22type%22%7C%22isArray%22%7C%22isRequired%22%7C%22isArrayNullable%22%7C%22arguments%22)%3E"
},
"Pick<Field,(\"name\"|\"type\"|\"isArray\"|\"isRequired\"|\"isArrayNullable\"|\"arguments\")>": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"$ref": "#/definitions/FieldType"
},
"isArray": {
"type": "boolean"
},
"isRequired": {
"type": "boolean"
},
"isArrayNullable": {
"type": "boolean"
},
"arguments": {
"$ref": "#/definitions/Arguments"
}
},
"required": [
"name",
"type",
"isArray",
"isRequired"
],
"additionalProperties": false
},
"SchemaMutations": {
"$ref": "#/definitions/Record%3Cstring%2CSchemaMutation%3E"
},
"Record<string,SchemaMutation>": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/SchemaMutation"
}
},
"SchemaMutation": {
"$ref": "#/definitions/SchemaQuery"
},
"SchemaSubscriptions": {
"$ref": "#/definitions/Record%3Cstring%2CSchemaSubscription%3E"
},
"Record<string,SchemaSubscription>": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/SchemaSubscription"
}
},
"SchemaSubscription": {
"$ref": "#/definitions/SchemaQuery"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe('processIndex', () => {
arguments: {
name: 'testModelsByConnectionFieldAndSortField',
fields: ['connectionField', 'sortField'],
queryField: undefined,
queryField: undefined,
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1612,179 +1612,6 @@ exports[`Custom primary key tests should generate correct model intropection fil
}"
`;

exports[`Custom queries/mutations/subscriptions tests should generate correct metadata for custom queries/mutations/subscriptions in model introspection schema 1`] = `
"{
\\"version\\": 1,
\\"models\\": {
\\"Todo\\": {
\\"name\\": \\"Todo\\",
\\"fields\\": {
\\"id\\": {
\\"name\\": \\"id\\",
\\"isArray\\": false,
\\"type\\": \\"ID\\",
\\"isRequired\\": true,
\\"attributes\\": []
},
\\"name\\": {
\\"name\\": \\"name\\",
\\"isArray\\": false,
\\"type\\": \\"String\\",
\\"isRequired\\": true,
\\"attributes\\": []
},
\\"description\\": {
\\"name\\": \\"description\\",
\\"isArray\\": false,
\\"type\\": \\"String\\",
\\"isRequired\\": false,
\\"attributes\\": []
},
\\"createdAt\\": {
\\"name\\": \\"createdAt\\",
\\"isArray\\": false,
\\"type\\": \\"AWSDateTime\\",
\\"isRequired\\": false,
\\"attributes\\": [],
\\"isReadOnly\\": true
},
\\"updatedAt\\": {
\\"name\\": \\"updatedAt\\",
\\"isArray\\": false,
\\"type\\": \\"AWSDateTime\\",
\\"isRequired\\": false,
\\"attributes\\": [],
\\"isReadOnly\\": true
}
},
\\"syncable\\": true,
\\"pluralName\\": \\"Todos\\",
\\"attributes\\": [
{
\\"type\\": \\"model\\",
\\"properties\\": {}
}
],
\\"primaryKeyInfo\\": {
\\"isCustomPrimaryKey\\": false,
\\"primaryKeyFieldName\\": \\"id\\",
\\"sortKeyFieldNames\\": []
}
}
},
\\"enums\\": {},
\\"nonModels\\": {
\\"Phone\\": {
\\"name\\": \\"Phone\\",
\\"fields\\": {
\\"number\\": {
\\"name\\": \\"number\\",
\\"isArray\\": false,
\\"type\\": \\"String\\",
\\"isRequired\\": false,
\\"attributes\\": []
}
}
}
},
\\"queries\\": {
\\"echo\\": {
\\"name\\": \\"echo\\",
\\"isArray\\": false,
\\"type\\": \\"String\\",
\\"isRequired\\": false,
\\"arguments\\": {
\\"msg\\": {
\\"name\\": \\"msg\\",
\\"isArray\\": false,
\\"type\\": \\"String\\",
\\"isRequired\\": false
}
}
},
\\"echo2\\": {
\\"name\\": \\"echo2\\",
\\"isArray\\": false,
\\"type\\": {
\\"model\\": \\"Todo\\"
},
\\"isRequired\\": false,
\\"arguments\\": {
\\"todoId\\": {
\\"name\\": \\"todoId\\",
\\"isArray\\": false,
\\"type\\": \\"ID\\",
\\"isRequired\\": true
}
}
},
\\"echo3\\": {
\\"name\\": \\"echo3\\",
\\"isArray\\": true,
\\"type\\": {
\\"model\\": \\"Todo\\"
},
\\"isRequired\\": false,
\\"isArrayNullable\\": true
},
\\"echo4\\": {
\\"name\\": \\"echo4\\",
\\"isArray\\": false,
\\"type\\": {
\\"nonModel\\": \\"Phone\\"
},
\\"isRequired\\": false,
\\"arguments\\": {
\\"number\\": {
\\"name\\": \\"number\\",
\\"isArray\\": false,
\\"type\\": \\"String\\",
\\"isRequired\\": false
}
}
}
},
\\"mutations\\": {
\\"mutate\\": {
\\"name\\": \\"mutate\\",
\\"isArray\\": false,
\\"type\\": {
\\"model\\": \\"Todo\\"
},
\\"isRequired\\": false,
\\"arguments\\": {
\\"msg\\": {
\\"name\\": \\"msg\\",
\\"isArray\\": true,
\\"type\\": \\"String\\",
\\"isRequired\\": true,
\\"isArrayNullable\\": false
}
}
}
},
\\"subscriptions\\": {
\\"onMutate\\": {
\\"name\\": \\"onMutate\\",
\\"isArray\\": true,
\\"type\\": {
\\"model\\": \\"Todo\\"
},
\\"isRequired\\": true,
\\"isArrayNullable\\": true,
\\"arguments\\": {
\\"msg\\": {
\\"name\\": \\"msg\\",
\\"isArray\\": false,
\\"type\\": \\"String\\",
\\"isRequired\\": false
}
}
}
}
}"
`;

exports[`Model Introspection Visitor Metadata snapshot should generate correct model intropection file validated by JSON schema 1`] = `
"{
\\"version\\": 1,
Expand Down
Loading

0 comments on commit a1b46b1

Please sign in to comment.