Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Session type parameter for TypeInfo, Lists and Context #8570

Merged
merged 19 commits into from
May 18, 2023
Merged

Conversation

dcousens
Copy link
Member

@dcousens dcousens commented May 11, 2023

This pull request amends the types exported by Keystone to support a new Session type parameter for TypeInfo, written as TypeInfo<Session>.

The following type parameters have been added:

  • TypeInfo<Session>
  • Lists<Session>
  • Context<Session>
  • Config<Session>

The new Session type parameter will propagate to the underlying functions and schema in the same manner as Context, ensuring that context.session is changed from the default of any.

This pull request additionally adds or fixes a number of session related examples to adhere to this new format, and actually resolved a few type errors that had existed with respect to the previous Session types used in the examples. 🎉

@changeset-bot

This comment was marked as resolved.

@dcousens dcousens requested a review from borisno2 May 11, 2023 11:37
@dcousens dcousens self-assigned this May 11, 2023
*
* @default keystonejs-session
*/
cookieName?: string;
Copy link
Member Author

@dcousens dcousens May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this, as keystonejs-session as a cookie name was wildly opinionated

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 11, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@dcousens dcousens changed the title Fix SessionStore types, and deprecate SessionStores Fix Session types May 11, 2023
@dcousens dcousens force-pushed the custom-redis branch 5 times, most recently from ec152ca to 5f8188c Compare May 15, 2023 04:15
@dcousens dcousens changed the title Fix Session types Add Session type parameter for TypeInfo, Lists and Context May 17, 2023
@dcousens dcousens force-pushed the custom-redis branch 6 times, most recently from c036694 to 50271fd Compare May 18, 2023 02:20
Copy link
Member

@borisno2 borisno2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Work!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants