This repository was archived by the owner on Mar 24, 2020. It is now read-only.
Add non-'.graphql' filetype support for graphql operations codegen#46
Open
thisjeremiah wants to merge 3 commits intoamazon-archives:masterfrom
Open
Add non-'.graphql' filetype support for graphql operations codegen#46thisjeremiah wants to merge 3 commits intoamazon-archives:masterfrom
thisjeremiah wants to merge 3 commits intoamazon-archives:masterfrom
Conversation
Update `listStackResources` to recursively list nested stack resources. Creates compatibility with `serverless-plugin-split-stacks`.
Add operations codegen support for other filetypes, where filetype is based on file extension.
adrianhall
suggested changes
Jan 24, 2019
| scala: 'scala', | ||
| graphql: 'graphql', | ||
| }[fileType]; | ||
| graphqlGenerator(schemaFile, fileDetails.filename, { language }); |
Contributor
There was a problem hiding this comment.
This does not provide any error handling when the language is not one of those listed. In that case, language will be explicitly undefined and that will cause horrible errors. Please add error handling appropriate to the situation.
valeeum
suggested changes
May 29, 2019
valeeum
left a comment
There was a problem hiding this comment.
@adrianhall @thisjeremiah how about something like so?
| swift: 'swift', | ||
| scala: 'scala', | ||
| graphql: 'graphql', | ||
| }[fileType]; |
There was a problem hiding this comment.
Suggested change
| }[fileType]; | |
| }[fileType]; | |
| if(language == null) { | |
| throw new Error(`File type '${fileType}' not supported for GraphQL operations`); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
#43
Description of changes:
Add non-'.graphql' filetype support for graphql operations codegen. Infer file type by file extension.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.