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

Idea: rework resource dependent options #128

Open
macrozone opened this issue Mar 23, 2023 · 3 comments
Open

Idea: rework resource dependent options #128

macrozone opened this issue Mar 23, 2023 · 3 comments

Comments

@macrozone
Copy link
Member

options grew organically and currenlty contain (among others):

  • ResourceViews, which was initially to create "virtual" resource, but can now be used to customize fragment for one and many queries
  • customizeInputData, can be used to alter input data before beeing sent to the backend
  • filters, can be used to create custom filters. They are currently global, and not dependent on resources, which is odd

all those options kindof are related to a specific resource, so we could consider to rework those into something like this:


type Options = {

  resources: ResourceOptions

...

}


type ResourceOptions = Record<string, ResourceOption> // whereas key is the resourceName

type ResourceOption = {
   backendResource?: string // defaults to the key. This can be altered for "virtual" resources
  fragments: { // to alter what data is fetched, 
     one: ...,
     many: ... 
  },
  customizeInputData: {
     create: ...,
     update: ...
  },
filters: ...
}

so basically group the options. That will make it a bit easier to think about further improvements and customizations and is more logical

@macrozone
Copy link
Member Author

@knapeto What do you think?

@macrozone macrozone changed the title rework resource dependent options Idea: rework resource dependent options Mar 23, 2023
@knapeto
Copy link
Collaborator

knapeto commented Mar 24, 2023

I like it! I've never used customization for input data but make sense to me. Thanks for briefing @macrozone

@macrozone
Copy link
Member Author

macrozone commented Mar 24, 2023

I like it! I've never used customization for input data but make sense to me. Thanks for briefing @macrozone

i actually just used it as a workaround (i was not even aware that we have it), i'll write this in a new ticket, since you might also stumbled across this #129

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

No branches or pull requests

2 participants