You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.4KB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Server
  2. - start creating types in schema.ts
  3. ```typescript
  4. import gql from "graphql-tag";
  5. export const pizzaSchema = gql``;
  6. ```
  7. - create types and querys
  8. - show generated code
  9. - create index.ts
  10. - index.ts
  11. ```typescript
  12. import { ApolloServer } from "apollo-server/dist";
  13. const server = new ApolloServer({});
  14. server.listen().then(({ url, subscriptionsUrl }) => {
  15. console.log(`🚀 Server ready at ${url}`)
  16. console.log(`🚀 Subscriptions ready at ${subscriptionsUrl}`);
  17. });
  18. ```
  19. - show playground and run listPizza
  20. - create resolve config with empty array
  21. - create pizza list
  22. - create pizzaResolver.ts
  23. - add read/list function
  24. - add resolver to resolver config
  25. - show get and list
  26. - add toppings
  27. - add list
  28. - add resolver
  29. - add toppings to pizza mocks
  30. - show type resolvers
  31. - show Mutation
  32. - show Subscription
  33. - show finished api
  34. # UI
  35. - init new Angular project
  36. ```
  37. git clone git@ziermach.de:cziermann/angular-demo-template.git
  38. ```
  39. ```
  40. npm i
  41. npm add apollo-angular
  42. ng add apollo-angular
  43. npm add graphql
  44. npm add --save-dev @graphql-codegen/cli
  45. npm i
  46. ```
  47. - init codegen
  48. ```
  49. npx graphql-codegen init
  50. npm i
  51. ```
  52. - check angular
  53. - use url "http://localhost:400"
  54. - fragment path default
  55. - plugin default
  56. - output default
  57. - set uri in graphql module
  58. - move
  59. - graphql.module
  60. ## Pizza component
  61. ```
  62. ng add @angular/material
  63. (style - default)
  64. ```
  65. ```
  66. ng g c pizza-list
  67. ```
  68. - copy
  69. - app.module.ts
  70. - app.component.ts
  71. - styles.css