Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from redwoodjs/pp-use-auto-schema-map
Use auto mapping of schema definition to services.
- Loading branch information
Showing
9 changed files
with
1,161 additions
and
352 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { server, makeMergedSchema } from '@redwoodjs/api' | ||
import importAll from '@redwoodjs/core/dist/importAll.macro' | ||
import { server, makeMergedSchema, makeServices } from '@redwoodjs/api' | ||
|
||
import * as todo from 'src/graphql/todo' | ||
|
||
const schema = makeMergedSchema([todo]) | ||
const schemas = importAll('api', 'graphql') | ||
const services = importAll('api', 'services') | ||
|
||
export const handler = server({ | ||
schema, | ||
schema: makeMergedSchema({ | ||
schemas, | ||
services: makeServices({ services }), | ||
}), | ||
}).createHandler() |
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
export const schema = ` | ||
type Todo { | ||
id: Int! | ||
body: String! | ||
status: String! | ||
} | ||
type Query { | ||
todos: [Todo] | ||
} | ||
type Mutation { | ||
createTodo(body: String!): Todo | ||
updateTodoStatus(id: Int!, status: String!): Todo | ||
renameTodo(id: Int!, body: String!): Todo | ||
} | ||
` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
module.exports = { | ||
presets: ["@babel/preset-react", "@babel/typescript"], | ||
presets: ['@babel/preset-react', '@babel/typescript'], | ||
plugins: [ | ||
["@babel/plugin-proposal-class-properties", { loose: true }], | ||
["@babel/plugin-proposal-export-default-from"], | ||
["@babel/plugin-proposal-object-rest-spread"], | ||
["@babel/plugin-proposal-optional-chaining"] | ||
] | ||
}; | ||
['@babel/plugin-proposal-class-properties', { loose: true }], | ||
['@babel/plugin-proposal-export-default-from'], | ||
['@babel/plugin-proposal-object-rest-spread'], | ||
['@babel/plugin-proposal-optional-chaining'], | ||
'macros', | ||
], | ||
} |
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
Oops, something went wrong.