AWS AppSync
Build and try GraphQL APIs locally: edit the schema, attach resolvers to DynamoDB tables or Lambda functions, and run queries with an API key, a Cognito user or IAM, the same way your app calls them.
Features
APIs
- List APIs with their authorization type and local GraphQL endpoint; find by name or ID
- Create an API with API key, Cognito user pool or AWS IAM authorization; it starts with a sample schema (an API key is created for you)
- Delete an API with its schema, data sources, resolvers, functions and API keys
- Stack: X link to CloudFormation when the API was deployed by a stack
Schema
- Edit the schema in a GraphQL editor and Save schema; Floci's validation errors are shown above the editor
- Resolvers table: every field of the schema, filtered by type, with its resolver, data source and runtime
- Attach resolver to a field, Edit or Delete an existing one; resolvers on fields no longer in the schema are flagged
- Unsaved schema or resolver changes ask before you leave the page
Resolvers
- Unit resolver (one data source) or pipeline resolver (functions in order, with Move up / Move down)
- JS or VTL runtime; the code editor fills in a starter template for the chosen data source
Data sources
- Create, edit and delete data sources of type None, DynamoDB table or Lambda function
- Links to the table or function behind each data source
- A data source still used by a resolver or function can't be deleted
Functions
- Create, edit and delete pipeline functions (name, data source, JS or VTL code)
- Used by column shows the resolvers that run each function
Queries
- Run queries and mutations against the API in Floci, with variables (JSON) and an operation picker when the document has several
- Choose the authorization: an API key, a Cognito user (sign in with app client, username and password right on the tab) or AWS IAM
- Response with HTTP status and time
Settings
- Details: name (editable), API ID, ARN, GraphQL endpoint for your machine and for containers in the same compose
- Edit authorization: default type, additional types, user pool (link to Cognito)
- API keys: create (description, expiry in days), copy, delete; expired keys are marked
- Connect card with Node.js and Python samples that call the endpoint with the API's authorization
Typical workflow
- On APIs, choose Create API, enter a name and keep API key authorization.
- On the Schema tab, edit the sample schema and choose Save schema.
- On the Data sources tab, choose Create data source and pick a DynamoDB table or a Lambda function.
- Back on Schema, select a field in the Resolvers table, choose Attach resolver, pick the data source, adjust the code and Save.
- On the Queries tab, write a query and choose Run; copy the endpoint and key from Settings into your app.
Works with
- Amazon DynamoDB: data sources read and write tables
- AWS Lambda: data sources call functions
- Amazon Cognito: user pool authorization, with sign-in on the Queries tab
- AWS CloudFormation: APIs deployed by a stack link to it
Limitations
- Floci has no subscriptions (WebSocket), resolver testing, caching, merged APIs or event APIs.
- HTTP data sources can be created by other tools but fail at query time; the console only offers None, DynamoDB and Lambda.
- Floci checks resolver and function code only when a query runs, not when you save: run a query in Queries after saving.
- Floci passes arguments to Lambda only through an
Invokerequest: a Lambda resolver without code gets an empty event. - A field reachable through additional Cognito authorization needs
@aws_cognito_user_pools(cognito_groups: [...])in the schema; Floci rejects the directive without groups. - The console can't run queries for APIs that use OpenID Connect or Lambda authorization, and can't edit that authorization: change it with your IaC.
- The first query starts two helper containers that publish ports on
0.0.0.0and keep running after every API is deleted: stop them by hand when you're done.