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

chore(gatsby): migrate schema reducer to TypeScript #23476

Closed
wants to merge 1 commit into from
Closed

chore(gatsby): migrate schema reducer to TypeScript #23476

wants to merge 1 commit into from

Conversation

hiwelo
Copy link
Contributor

@hiwelo hiwelo commented Apr 25, 2020

Description

This commit implements the migration of the schema reducer to TypeScript by adding the SET_SCHEMA action to the ActionsUnion and by adding the basic types from the IGatsbyState interface.

Related Issues

Related to #21995

@hiwelo hiwelo marked this pull request as ready for review April 25, 2020 12:19
@hiwelo hiwelo requested a review from a team as a code owner April 25, 2020 12:19
This commit implements the migration of the schema reducer to
TypeScript by adding the SET_SCHEMA action to the ActionsUnion and
by adding the basic types from the IGatsbyState.
@LekoArts
Copy link
Contributor

Hey @hiwelo 👋
Did you delete your fork? GitHub can't find your branch anymore thus showing unknown reposotiry

@hiwelo
Copy link
Contributor Author

hiwelo commented Apr 29, 2020

🤦 I think I deleted the fork entirely when I wanted to delete another branch 🤦
So yes @LekoArts, I will reopen my fork and push the branch with the resolution for the conflicted files.

@hiwelo
Copy link
Contributor Author

hiwelo commented Apr 29, 2020

Hmm, in fact I will open a new PR with the new branch. Sorry for that

import { ActionsUnion, IGatsbyState } from "../types"

export const schemaReducer = (
state: IGatsbyState["schema"] | {} = {},
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't quite what I was getting at. I think it would better if we could default this state to an instance of graphql schema. There are APIs and keys that are expected to be on this state. It's fragile to not have them there, even though we must be supporting that as is right now.

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.

4 participants