Which Api Client preference would you prefer? #201
Answered
by
mschilling
mschilling
asked this question in
Q&A
-
We willen een API client (kleine SDK) bouwen die je in iedere app kan gebruiken om gemakkelijk met Krew backend te praten. Deze API client zal behalve methods (tbv CRUD) ook alle models exporteren. Graag even laten weten welke API stijl je het meest aanspreekt Optie 1: alle methods onder 1 object Graag even upvoten wat je voorkeur heeft |
Beta Was this translation helpful? Give feedback.
Answered by
mschilling
Jul 9, 2021
Replies: 2 comments 1 reply
-
Optie 1 import { createKrewClient, NewsItem } from '@krew/api-client';
...
const apiClient = createKrewClient({});
apiClient.getNewsItems();
apiClient.getNewsItem(12345);
apiClient.getEmployees(); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Optie 2 import { createKrewClient, NewsItem } from '@krew/api-client';
...
const apiClient = createKrewClient({});
apiClient.news.findMany();
apiClient.news.findOne(12345);
apiClient.employees.findMany(); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mschilling
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Optie 2