question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🚸 IMPROVE: kitQL codegen - Provide (generic?) type for stores

See original GitHub issue

Package graphql-codegen

  • KQL stores should maybe have a type (ideally generic).

Example:

  • with Sveltekit I can pass a store as a param, e.g a Writable<T>

  • when it comes to a KQL custom store, i have no type to provide.

    export const storyblok = (node: HTMLElement, storyStore: KQLStore<PageDetailFragment>) => { 
       // I do things here including using storyStore.patch
    }
    

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jbruxellecommented, Mar 16, 2022

Works fines using typeof, I do not need more since this is for a very specific usage. 🎉

1reaction
jycouetcommented, Mar 7, 2022

What about

function myCoolFunction(store: typeof KQL_AllContinents) {
	store.resetCache();
}

😯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use of generic type in codegen for typescript? #109 - GitHub
The unrestricted generic type generated is causing some trouble to here. For example in this generated definition: export interface Query { me: (...
Read more >
typescript-generic-sdk - GraphQL Code Generator
This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, ...
Read more >
Getting Started with KitQL and GraphCMS - Scott Spence
To be able to do code gen on this there needs to be a schema for use in the .graphqlrc.yaml file. The schema...
Read more >
How to specify a generic type class for Swagger API response
I am using swagger 2 and following resolved this problem for me. Remove 'response' property from both @ApiResponse and @ApiOperation .
Read more >
Generics: How They Work and Why They Are Important - Oracle
Therefore, you need to develop a container that has the ability to store ... A generic type is a class or interface that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found