This repository was archived by the owner on Dec 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
[WIP] Support enums #244
Merged
Merged
[WIP] Support enums #244
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
238adaf
Started implementing enum support
Weakky 440bd40
Refactored ts introspection to truly parse model files
Weakky 1d38810
Enhanced introspection to easily resolve referenced type
Weakky eeb4859
Render inlined enums (from GraphQL schema)
Weakky 5ee86d4
Implemented smart scaffolding for enums
Weakky 561ac12
Refactor typescript parser to make flow support smart enums
Weakky bd8e560
Fixed flow export scaffold
Weakky e9a87f3
Added support for `enums` in typescript
Weakky 3d6f9ad
Updated tests
Weakky 6eb4f0d
Released 0.3.0-beta1
schickling 5dd091d
Merge branch 'master' into feature/enums-support
schickling 568ceac
Review fixes
Weakky 8f231c0
Scoped flow input types
Weakky 67b6a4d
Defined unhandled types as unknown and removed console.log/throws
Weakky cc1fd52
Updated tests
Weakky 11ed8ca
Review fix
Weakky 93d2807
Updated tests
Weakky b4f53ac
Updated templates
Weakky 35b236d
Handle interface's field name as string
Weakky f0493ba
Released 0.3.0-beta3
schickling dc12246
Released 0.3.0-beta4
schickling 82a6a7a
Merge branch 'master' into feature/enums-support
schickling File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
5 changes: 4 additions & 1 deletion
5
packages/graphqlgen-templates/flow-yoga/src/generated/tmp-resolvers/index.js
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// Code generated by github.com/prisma/graphqlgen, DO NOT EDIT. | ||
|
||
import { GraphQLResolveInfo } from 'graphql' | ||
import { Context } from '../types' | ||
import { Post } from '../types' | ||
import { User } from '../types' | ||
import { Context } from '../types' | ||
|
||
export namespace QueryResolvers { | ||
export const defaultResolvers = {} | ||
|
@@ -141,8 +141,7 @@ export namespace PostResolvers { | |
export namespace UserResolvers { | ||
export const defaultResolvers = { | ||
id: (parent: User) => parent.id, | ||
name: (parent: User) => | ||
parent.name === undefined || parent.name === null ? null : parent.name, | ||
name: (parent: User) => (parent.name === undefined ? null : parent.name), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The parenthesis aren't in the code generator. They must be added by prettier somehow 😕 |
||
} | ||
|
||
export type IdResolver = ( | ||
|
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.