Skip to content
This repository was archived by the owner on Mar 24, 2020. It is now read-only.

Conversation

thisjeremiah
Copy link
Contributor

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.

thisjeremiah and others added 3 commits January 16, 2019 10:41
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.
scala: 'scala',
graphql: 'graphql',
}[fileType];
graphqlGenerator(schemaFile, fileDetails.filename, { language });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@valeeum valeeum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adrianhall @thisjeremiah how about something like so?

swift: 'swift',
scala: 'scala',
graphql: 'graphql',
}[fileType];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}[fileType];
}[fileType];
if(language == null) {
throw new Error(`File type '${fileType}' not supported for GraphQL operations`);
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants