forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: add enum types to generated sdl.js (redwoodjs#454)
* feat: add enum types to generated sdl.js * chore: remove redundant comment * fix: make lint and current tests pass added parser to the sdl.js output * fix: change db provider to allow enums due to dropped support * fix: fix template to not include wild spaces * fix: remove unnecessary spaces around enum definitions * fix: make field const instead of let * fix: single enum scaffolded without spaces * fix: spacing of multiple enums generated
- Loading branch information
1 parent
f8a2d0b
commit aa0b9ac
Showing
6 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
packages/cli/src/commands/generate/sdl/__tests__/fixtures/enumGeneratedSdl.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export const schema = gql` | ||
type Shoe { | ||
id: Int! | ||
color: Color! | ||
} | ||
enum Color { | ||
RED | ||
GREEN | ||
BLUE | ||
} | ||
type Query { | ||
shoes: [Shoe!]! | ||
shoe(id: Int!): Shoe! | ||
} | ||
input CreateShoeInput { | ||
color: Color! | ||
} | ||
input UpdateShoeInput { | ||
color: Color | ||
} | ||
type Mutation { | ||
createShoe(input: CreateShoeInput!): Shoe! | ||
updateShoe(id: Int!, input: UpdateShoeInput!): Shoe! | ||
deleteShoe(id: Int!): Shoe! | ||
} | ||
` |
This file contains 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 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 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 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 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