-
-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add feature for resolvers to exist outside of Blitz root (#3953)
Co-authored-by: Paul Moss <[email protected]> Co-authored-by: Brandon Bayer <[email protected]> Co-authored-by: Dillon Raphael <[email protected]>
- Loading branch information
1 parent
d250346
commit ed2b0e2
Showing
11 changed files
with
101 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@blitzjs/rpc": patch | ||
--- | ||
|
||
Add ability to put your query and mutation resolvers in a separate monorepo folder, allowing you to use them in multiple apps. |
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
integration-tests/no-suspense/app/queries/getNoSuspenseBasic.ts
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,3 @@ | ||
export default async function getNoSuspenseBasic() { | ||
return "basic-result" | ||
} |
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,2 +1,6 @@ | ||
const {withBlitz} = require("@blitzjs/next") | ||
module.exports = withBlitz({}) | ||
module.exports = withBlitz({ | ||
blitz: { | ||
includeRPCFolders: ["../no-suspense/app"], | ||
}, | ||
}) |
35 changes: 35 additions & 0 deletions
35
integration-tests/react-query-utils/pages/page-with-monorepo-query.tsx
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,35 @@ | ||
import {getQueryData, useQuery} from "@blitzjs/rpc" | ||
import {Suspense, useState} from "react" | ||
import getNoSuspenseBasic from "../../no-suspense/app/queries/getNoSuspenseBasic" | ||
|
||
function Content() { | ||
const [data] = useQuery(getNoSuspenseBasic, undefined) | ||
const [newData, setNewData] = useState<string>() | ||
return ( | ||
<div> | ||
<div>{data}</div> | ||
{newData && <div id="new-data">{newData}</div>} | ||
<button | ||
id="button" | ||
onClick={async () => { | ||
const newData = getQueryData(getNoSuspenseBasic, undefined) | ||
setNewData(newData) | ||
}} | ||
> | ||
Call getQueryData | ||
</button> | ||
</div> | ||
) | ||
} | ||
|
||
function PageWithGetQueryData() { | ||
return ( | ||
<div id="page"> | ||
<Suspense fallback={"Loading..."}> | ||
<Content /> | ||
</Suspense> | ||
</div> | ||
) | ||
} | ||
|
||
export default PageWithGetQueryData |
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