graphql-engine/frontend/libs/open-api-to-graphql/test/README.md
Varun Choudhary 35d9c059db console: open api to graphql library
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9420
Co-authored-by: Nicolas Beaussart <7281023+beaussan@users.noreply.github.com>
GitOrigin-RevId: 31d983ae8573c91ac5bf11066770f776941c3a11
2023-06-13 19:58:02 +00:00

6.6 KiB

Tests

We have a number of test suites used to verify the behavior of OpenAPI-to-GraphQL.

Tests against real-world APIs

The following test suites perform a simple wrapping test and do not make call against any of the respective APIs.

API Test file
N/A cloudfunction.test.ts
DocuSign docusign.test.ts
N/A government_social_work.test.ts
IBM Language Translator ibm_language_translator.test.ts
Instagram instagram.test.ts
Stripe stripe.test.ts
Weather Underground weather_underground_test.ts

Tests against custom APIs

We have created a number of example APIs for finer grain testing. Unfortunately, for a number of reasons including difficulty keeping tests on theme and some tests requiring their own specialized APIs, the number of tests have quickly grown and do not have meaningful identifiers.

The following table summarizes the purposes of these tests.

Test file API(s) Testing purpose
example_api.test.ts Example API An assortment of basic functionality and options on a company-themed API
authentication.test.ts Example API Basic authentication tests including using the viewer functionality
example_api2.test.ts Example API 2 The operationIdFieldNames option
example_api3.test.ts Example API and Example API 3 Creating GraphQL wrappers from multiple APIs and interOAS links
example_api4.test.ts Example API 4 JSON schema combining schema keywords
example_api5.test.ts Example API 5 The simpleNames option
example_api6.test.ts Example API 6 An assortment of other functionality and options
example_api7.test.ts Example API 7 Subscription support
file_upload.test.ts File Upload API File uploads and file upload options
extensions.test.ts Extensions, Extensions Error 1, Extensions Error 2, Extensions Error 3, Extensions Error 4, Extensions Error 5, Extensions Error 6, Extensions Error 7 The x-graphql-field-name, x-graphql-type-name, and x-graphql-enum-mapping extensions