如何使用Neo4J GraphQl库在CRUD操作上构建图形?

发布于 2025-02-12 11:43:12 字数 1132 浏览 0 评论 0原文

我试图使用Neo4J GraphQl库构建GrandStack应用程序。而不是像已经存在的数据那样,而是像Neo4J Internet中显示的大多数教程一样。我想通过使用React表单询问用户数据来构建图形。由于我是Neo4J GraphQl库和Apollo服务器的新手,因此我发现很难理解如何设置。

我已经在下面设置了一个示例React表单代码。从这里,我感到困惑如何使用Neo4J GraphQl库。有人可以在这里帮我吗?

import './App.css';
import {TextField, Button} from "@mui/material"
import {useState} from "react"
function App() {
  const [data, setdata] = useState("");
  const [datatwo, setdatatwo] = useState("");
  const onSubmit = (e) =>{
    e.preventDefault();
    alert({data})
  }
  return (
    <div className="App">
      <form  noValidate onSubmit={onSubmit}>
      <TextField id="outlined-basic" label="Name" variant="outlined" onChange={(e)=>setdata(e.target.value)}/>
      <TextField id="outlined-basic" label="Name" variant="outlined" onChange={(e)=>setdatatwo(e.target.value)}/>
      <Button variant="contained">Submit</Button>
      </form>
      <div>First Name is:{data}</div>
      <div>last Name is:{datatwo}</div>
    </div>
  );
}
export default App;

I was trying to build grandstack app using neo4j graphql library. Rather than working on already existing data, like the most tutorials shown in the internet for neo4j. I want to build a graph by asking the user data using a react form. As I am new to neo4j graphql library and apollo server i am finding it hard to understand how to setup.

I have setup an example react form code below. From here i was getting confused how to use neo4j graphql library. can some one help me here.

import './App.css';
import {TextField, Button} from "@mui/material"
import {useState} from "react"
function App() {
  const [data, setdata] = useState("");
  const [datatwo, setdatatwo] = useState("");
  const onSubmit = (e) =>{
    e.preventDefault();
    alert({data})
  }
  return (
    <div className="App">
      <form  noValidate onSubmit={onSubmit}>
      <TextField id="outlined-basic" label="Name" variant="outlined" onChange={(e)=>setdata(e.target.value)}/>
      <TextField id="outlined-basic" label="Name" variant="outlined" onChange={(e)=>setdatatwo(e.target.value)}/>
      <Button variant="contained">Submit</Button>
      </form>
      <div>First Name is:{data}</div>
      <div>last Name is:{datatwo}</div>
    </div>
  );
}
export default App;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文