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(wrapper): remove additional graphql getters #2986

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2041,18 +2041,6 @@ declare namespace Spicetify {
* Collection of GraphQL definitions.
*/
const Definitions: Record<Query | string, any>;
/**
* GraphQL query definitions. Subset of `Definitions` that are used as query requests.
*/
const QueryDefinitions: Record<Query | string, any>;
/**
* GraphQL mutation definitions. Subset of `Definitions` that are used as mutation requests.
*/
const MutationDefinitions: Record<Query | string, any>;
/**
* GraphQL response definitions. Subset of `Definitions` that are used as response types.
*/
const ResponseDefinitions: Record<Query | string, any>;
/**
* Sends a GraphQL query to Spotify.
* @description A preinitialized version of `Spicetify.GraphQL.Handler` using current context.
Expand Down
19 changes: 0 additions & 19 deletions jsHelper/spicetifyWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,25 +515,6 @@ window.Spicetify = {
get Request() {
return Spicetify.Platform?.GraphQLLoader || Spicetify.GraphQL.Handler?.(Spicetify.GraphQL.Context);
},
get QueryDefinitions() {
return Object.fromEntries(
Object.entries(Spicetify.GraphQL.Definitions).filter(([, value]) =>
value.definitions.some(def => def.kind === "OperationDefinition" && def.operation === "query")
)
);
},
get MutationDefinitions() {
return Object.fromEntries(
Object.entries(Spicetify.GraphQL.Definitions).filter(([, value]) =>
value.definitions.some(def => def.kind === "OperationDefinition" && def.operation === "mutation")
)
);
},
get ResponseDefinitions() {
return Object.fromEntries(
Object.entries(Spicetify.GraphQL.Definitions).filter(([, value]) => value.definitions.every(def => def.kind !== "OperationDefinition"))
);
},
Context: functionModules.find(m => m.toString().includes("subscription") && m.toString().includes("mutation")),
Handler: functionModules.find(m => m.toString().includes("GraphQL subscriptions are not supported"))
},
Expand Down