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.
Merge branch 'main' of github.com:redwoodjs/redwood into try/dbauth-s…
…sr-updated-forward-cookies * 'main' of github.com:redwoodjs/redwood: (163 commits) chore(deps): update dependency @clerk/clerk-react to v4.28.3 (redwoodjs#9643) fix(deps): update prisma monorepo to v5.7.0 (redwoodjs#9642) fix(CLI): merge NODE_OPTIONS in `yarn rw dev` (redwoodjs#9585) chore(release): configure aloglia to index docs chore(release): handle OTP for lerna publish RSC: No need to patch Vite anymore (redwoodjs#9636) RSC: Remove unused code. Improve code organization (redwoodjs#9631) chore(release): improve tooling chore: Linting and disable some console logs (redwoodjs#9635) chore: Update Testing documentation to link to How to Test Email/Mailer (redwoodjs#9634) chore(release): fix open answer Add vscode web debugger and compound (redwoodjs#9567) RSC: Use Routes.tsx for (client-side) routing (redwoodjs#9630) RSC: Add RW env var definitions to Vite config and include FatalErrorBoundary (redwoodjs#9622) chore(release): add notes on redwoodjs#9624 chore(release): add release:notes scripts, fix docs chore(deps): update dependency @clerk/clerk-react to v4.28.2 (redwoodjs#9625) fix(deps): update dependency @vitejs/plugin-react to v4.2.1 (redwoodjs#9626) fix(deps): update dependency vite to v4.5.1 (redwoodjs#9627) fix(deps): update storybook monorepo to v7.6.3 (redwoodjs#9628) ...
- Loading branch information
Showing
371 changed files
with
19,479 additions
and
17,219 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
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 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
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 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
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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 +1 @@ | ||
lts/* | ||
v18 |
10 changes: 10 additions & 0 deletions
10
__fixtures__/example-todo-main/api/src/lib/trustedDocumentsStore.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,10 @@ | ||
export const store = { | ||
d67f5d54ba7d2a94e34809f20a0380f9921a5586: | ||
'mutation AddTodo_CreateTodo($body: String!) { __typename createTodo(body: $body) { __typename body id status } }', | ||
'81a7e7b720f992f8cfcaab15f42cf5a6802ed338': | ||
'query NumTodosCell_GetCount { __typename todosCount }', | ||
a9d0f2c090ac4320919f631ab0003fcdd2c30652: | ||
'query TodoListCell_GetTodos { __typename todos { __typename body id status } }', | ||
'69a8d2c6640912a8323a729adae2cc2f2f1bdb59': | ||
'mutation TodoListCell_CheckTodo($id: Int!, $status: String!) { __typename updateTodoStatus(id: $id, status: $status) { __typename id status } }', | ||
} |
66 changes: 66 additions & 0 deletions
66
__fixtures__/example-todo-main/web/src/graphql/fragment-masking.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,66 @@ | ||
import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core'; | ||
import { FragmentDefinitionNode } from 'graphql'; | ||
import { Incremental } from './graphql'; | ||
|
||
|
||
export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration< | ||
infer TType, | ||
any | ||
> | ||
? [TType] extends [{ ' $fragmentName'?: infer TKey }] | ||
? TKey extends string | ||
? { ' $fragmentRefs'?: { [key in TKey]: TType } } | ||
: never | ||
: never | ||
: never; | ||
|
||
// return non-nullable if `fragmentType` is non-nullable | ||
export function useFragment<TType>( | ||
_documentNode: DocumentTypeDecoration<TType, any>, | ||
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ||
): TType; | ||
// return nullable if `fragmentType` is nullable | ||
export function useFragment<TType>( | ||
_documentNode: DocumentTypeDecoration<TType, any>, | ||
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined | ||
): TType | null | undefined; | ||
// return array of non-nullable if `fragmentType` is array of non-nullable | ||
export function useFragment<TType>( | ||
_documentNode: DocumentTypeDecoration<TType, any>, | ||
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | ||
): ReadonlyArray<TType>; | ||
// return array of nullable if `fragmentType` is array of nullable | ||
export function useFragment<TType>( | ||
_documentNode: DocumentTypeDecoration<TType, any>, | ||
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined | ||
): ReadonlyArray<TType> | null | undefined; | ||
export function useFragment<TType>( | ||
_documentNode: DocumentTypeDecoration<TType, any>, | ||
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined | ||
): TType | ReadonlyArray<TType> | null | undefined { | ||
return fragmentType as any; | ||
} | ||
|
||
|
||
export function makeFragmentData< | ||
F extends DocumentTypeDecoration<any, any>, | ||
FT extends ResultOf<F> | ||
>(data: FT, _fragment: F): FragmentType<F> { | ||
return data as FragmentType<F>; | ||
} | ||
export function isFragmentReady<TQuery, TFrag>( | ||
queryNode: DocumentTypeDecoration<TQuery, any>, | ||
fragmentNode: TypedDocumentNode<TFrag>, | ||
data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined | ||
): data is FragmentType<typeof fragmentNode> { | ||
const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__ | ||
?.deferredFields; | ||
|
||
if (!deferredFields) return true; | ||
|
||
const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined; | ||
const fragName = fragDef?.name?.value; | ||
|
||
const fields = (fragName && deferredFields[fragName]) || []; | ||
return fields.length > 0 && fields.every(field => data && field in data); | ||
} |
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,73 @@ | ||
/* eslint-disable */ | ||
import * as types from "./graphql"; | ||
import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core"; | ||
|
||
/** | ||
* Map of all GraphQL operations in the project. | ||
* | ||
* This map has several performance disadvantages: | ||
* 1. It is not tree-shakeable, so it will include all operations in the project. | ||
* 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle. | ||
* 3. It does not support dead code elimination, so it will add unused operations. | ||
* | ||
* Therefore it is highly recommended to use the babel or swc plugin for production. | ||
*/ | ||
const documents = { | ||
"\n mutation AddTodo_CreateTodo($body: String!) {\n createTodo(body: $body) {\n id\n __typename\n body\n status\n }\n }\n": | ||
types.AddTodo_CreateTodoDocument, | ||
"\n query NumTodosCell_GetCount {\n todosCount\n }\n": | ||
types.NumTodosCell_GetCountDocument, | ||
"\n query TodoListCell_GetTodos {\n todos {\n id\n body\n status\n }\n }\n": | ||
types.TodoListCell_GetTodosDocument, | ||
"\n mutation TodoListCell_CheckTodo($id: Int!, $status: String!) {\n updateTodoStatus(id: $id, status: $status) {\n id\n __typename\n status\n }\n }\n": | ||
types.TodoListCell_CheckTodoDocument, | ||
}; | ||
|
||
/** | ||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. | ||
* | ||
* | ||
* @example | ||
* ```ts | ||
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`); | ||
* ``` | ||
* | ||
* The query argument is unknown! | ||
* Please regenerate the types. | ||
*/ | ||
export function graphql(source: string): unknown; | ||
|
||
/** | ||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. | ||
*/ | ||
export function graphql( | ||
source: "\n mutation AddTodo_CreateTodo($body: String!) {\n createTodo(body: $body) {\n id\n __typename\n body\n status\n }\n }\n" | ||
): (typeof documents)["\n mutation AddTodo_CreateTodo($body: String!) {\n createTodo(body: $body) {\n id\n __typename\n body\n status\n }\n }\n"]; | ||
/** | ||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. | ||
*/ | ||
export function graphql( | ||
source: "\n query NumTodosCell_GetCount {\n todosCount\n }\n" | ||
): (typeof documents)["\n query NumTodosCell_GetCount {\n todosCount\n }\n"]; | ||
/** | ||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. | ||
*/ | ||
export function graphql( | ||
source: "\n query TodoListCell_GetTodos {\n todos {\n id\n body\n status\n }\n }\n" | ||
): (typeof documents)["\n query TodoListCell_GetTodos {\n todos {\n id\n body\n status\n }\n }\n"]; | ||
/** | ||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. | ||
*/ | ||
export function graphql( | ||
source: "\n mutation TodoListCell_CheckTodo($id: Int!, $status: String!) {\n updateTodoStatus(id: $id, status: $status) {\n id\n __typename\n status\n }\n }\n" | ||
): (typeof documents)["\n mutation TodoListCell_CheckTodo($id: Int!, $status: String!) {\n updateTodoStatus(id: $id, status: $status) {\n id\n __typename\n status\n }\n }\n"]; | ||
|
||
export function graphql(source: string) { | ||
return (documents as any)[source] ?? {}; | ||
} | ||
|
||
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = | ||
TDocumentNode extends DocumentNode<infer TType, any> ? TType : never; | ||
export function gql(source: string) { | ||
return graphql(source); | ||
} |
Oops, something went wrong.