|  | 
| 1 |  | -import { FunctionTransformer } from '@aws-amplify/graphql-function-transformer'; | 
| 2 | 1 | import { ModelTransformer } from '@aws-amplify/graphql-model-transformer'; | 
| 3 | 2 | import { mockSqlDataSourceStrategy, testTransform } from '@aws-amplify/graphql-transformer-test-utils'; | 
| 4 | 3 | import { PrimaryKeyTransformer } from '@aws-amplify/graphql-index-transformer'; | 
| @@ -41,7 +40,6 @@ const makeTransformers = (): TransformerPluginProvider[] => [ | 
| 41 | 40 |   new AuthTransformer(), | 
| 42 | 41 |   new PrimaryKeyTransformer(), | 
| 43 | 42 |   new SqlTransformer(), | 
| 44 |  | -  new FunctionTransformer(), | 
| 45 | 43 | ]; | 
| 46 | 44 | 
 | 
| 47 | 45 | const makeSqlDirectiveDataSourceStrategies = (schema: string, strategy: ModelDataSourceStrategy): SqlDirectiveDataSourceStrategy[] => | 
| @@ -369,7 +367,8 @@ describe('Custom operations have @aws_iam directives when enableIamAuthorization | 
| 369 | 367 |       expect(out.schema).not.toMatch(/onUpdateFooCustom: String.*@aws_iam/); | 
| 370 | 368 |     }); | 
| 371 | 369 | 
 | 
| 372 |  | -    test('Adds @aws_iam to non-model custom types when there is no model', () => { | 
|  | 370 | +    // TODO: Enable this test once we fix https://github.com/aws-amplify/amplify-category-api/issues/2929 | 
|  | 371 | +    test.skip('Adds @aws_iam to non-model custom types when there is no model', () => { | 
| 373 | 372 |       const strategy = makeStrategy(strategyType); | 
| 374 | 373 |       const schema = /* GraphQL */ ` | 
| 375 | 374 |         type Foo { | 
| @@ -404,7 +403,8 @@ describe('Custom operations have @aws_iam directives when enableIamAuthorization | 
| 404 | 403 |       expect(out.schema).toMatch(/type Foo.*@aws_iam/); | 
| 405 | 404 |     }); | 
| 406 | 405 | 
 | 
| 407 |  | -    test('Adds @aws_iam to non-model custom types when there is a model', () => { | 
|  | 406 | +    // TODO: Enable this test once we fix https://github.com/aws-amplify/amplify-category-api/issues/2929 | 
|  | 407 | +    test.skip('Adds @aws_iam to non-model custom types when there is a model', () => { | 
| 408 | 408 |       const strategy = makeStrategy(strategyType); | 
| 409 | 409 |       const schema = /* GraphQL */ ` | 
| 410 | 410 |         type Todo @model { | 
| @@ -478,42 +478,6 @@ describe('Custom operations have @aws_iam directives when enableIamAuthorization | 
| 478 | 478 |       expect(out.schema).toMatch(/description: String.*@aws_iam/); | 
| 479 | 479 |     }); | 
| 480 | 480 | 
 | 
| 481 |  | -    test('Adds @aws_iam to async function EventInvocationResponse type', () => { | 
| 482 |  | -      const strategy = makeStrategy(strategyType); | 
| 483 |  | -      const schema = /* GraphQL */ ` | 
| 484 |  | -        type Foo { | 
| 485 |  | -          description: String | 
| 486 |  | -        } | 
| 487 |  | -        type EventInvocationResponse @aws_api_key { | 
| 488 |  | -          success: Boolean! | 
| 489 |  | -        } | 
| 490 |  | -        type Query { | 
| 491 |  | -          getFooCustom: Foo | 
| 492 |  | -        } | 
| 493 |  | -        type Mutation { | 
| 494 |  | -          updateFooCustom: Foo | 
| 495 |  | -          doSomethingAsync(body: String!): EventInvocationResponse | 
| 496 |  | -            @function(name: "FnDoSomethingAsync", invocationType: Event) | 
| 497 |  | -            @auth(rules: [{ allow: public, provider: apiKey }]) | 
| 498 |  | -        } | 
| 499 |  | -        type Subscription { | 
| 500 |  | -          onUpdateFooCustom: Foo @aws_subscribe(mutations: ["updateFooCustom"]) | 
| 501 |  | -        } | 
| 502 |  | -      `; | 
| 503 |  | - | 
| 504 |  | -      const out = testTransform({ | 
| 505 |  | -        schema, | 
| 506 |  | -        dataSourceStrategies: constructDataSourceStrategies(schema, strategy), | 
| 507 |  | -        authConfig: makeAuthConfig(), | 
| 508 |  | -        synthParameters: makeSynthParameters(), | 
| 509 |  | -        transformers: makeTransformers(), | 
| 510 |  | -        sqlDirectiveDataSourceStrategies: makeSqlDirectiveDataSourceStrategies(schema, strategy), | 
| 511 |  | -      }); | 
| 512 |  | - | 
| 513 |  | -      // Also expect the custom type referenced by the custom operation to be authorized | 
| 514 |  | -      expect(out.schema).toMatch(/type EventInvocationResponse.*@aws_iam/); | 
| 515 |  | -    }); | 
| 516 |  | - | 
| 517 | 481 |     test('Does not add duplicate @aws_iam directive to custom type if already present', () => { | 
| 518 | 482 |       const strategy = makeStrategy(strategyType); | 
| 519 | 483 |       const schema = /* GraphQL */ ` | 
|  | 
0 commit comments