在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):spring-petclinic/spring-petclinic-graphql开源软件地址(OpenSource Url):https://github.com/spring-petclinic/spring-petclinic-graphql开源编程语言(OpenSource Language):CSS 56.2%开源软件介绍(OpenSource Introduction):Spring PetClinic Sample Application using spring-graphqlThis PetClinic version uses the new spring-graphql project, that has been introduced in july 2021 and has been finally release as 1.0.0 GA version. This version uses Spring Boot 2.7 with GraphQL for Spring 1.0. It implements a GraphQL API for the PetClinic and provides an example Frontend for the API. FeaturesSome features that are built in:
Running the sample applicationYou can run the sample application with two ways:
Run it in GitPodTo run the application (backend, GraphiQL and React frontend) in GitPod, simply click on the "Open in GitPod" button at the top of this README.
After clicking on the GitPod button, GitPod creates a new workspace including an Editor for you, builds the application and starts backend and frontend. That might take some time! When backend and frontend are running, GitPod opens two new browser tabs, one with GraphiQL and one with the PetClinic backend. For login options, see below "Accessing the GraphQL API" Note that the workspace is your personal workspace, you can make changes, save files, re-open the workspace at any time and you can even create git commits and pull requests from it. For more information see GitPod documentation. In the GitPod editor you can make changes to the app, and after saving the app will be recompiled and redeployed automatically. Using IntelliJ with GitPodRecently GitPod has added support for JetBrain IDEs like IntelliJ. While this support is currenty beta only, you can try it and open the PetClinic in IntelliJ. Note that in this scenario you're still working on a complete, ready-to-use workspace in the cloud. Only the IntelliJ UI runs locally at your maching. Please read the setup instructions here. Running locallyThe server is implemented in the
Note: the server runs on port 9977, so make sure, this port is available. (The server uses an in-memory database, so no external DB is needed) Running the frontendWhile you can access the whole GraphQL API from GraphiQL this demo application also contains a modified version of the classic PetClinic UI. Compared to the original client this client is built as a Single-Page-Application using React and Apollo GraphQL and has slightly different features to make it a more realistic use-case for GraphQL. You can install and start the frontend by using npm:
The running frontend can be accessed on http://localhost:3000. For valid users to login, see list above. Accessing the GraphQL APIYou can access the GraphQL API via the included customized version of GraphiQL. The included GraphiQL adds support for login to the original GraphiQL. You can use the following users for login:
After starting the server, GraphiQL runs on http://localhost:9977 Sample QueriesHere you can find some sample queries that you can copy+paste and run in GraphiQL. Feel free to explore and try more |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论