1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[926],{8863:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>o,contentTitle:()=>n,default:()=>l,frontMatter:()=>i,metadata:()=>d,toc:()=>c});var s=t(4246),a=t(1670);const i={id:"graphql",title:"RAPID and GraphQL"},n=void 0,d={id:"related/graphql",title:"RAPID and GraphQL",description:"RAPID and GraphQL both provide a means of describing and requesting data from a service that represents a graph of data.",source:"@site/../docs/related/rapid-pro-graphql.md",sourceDirName:"related",slug:"/related/graphql",permalink:"/docs/related/graphql",draft:!1,unlisted:!1,editUrl:"https://github.com/oasis-open/odata-rapid/edit/main/docs/../docs/related/rapid-pro-graphql.md",tags:[],version:"current",frontMatter:{id:"graphql",title:"RAPID and GraphQL"},sidebar:"docs",previous:{title:"RAPID and OData",permalink:"/docs/related/odata"},next:{title:"RAPID and OpenAPI",permalink:"/docs/related/openapi"}},o={},c=[{value:"Schema Description",id:"schema-description",level:2},{value:"Query Syntax",id:"query-syntax",level:2},{value:"Filter",id:"filter",level:2},{value:"Use of HTTP",id:"use-of-http",level:2},{value:"Interoperability",id:"interoperability",level:2}];function h(e){const r={a:"a",code:"code",h2:"h2",p:"p",...(0,a.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.p,{children:"RAPID and GraphQL both provide a means of describing and requesting data from a service that represents a graph of data."}),"\n",(0,s.jsx)(r.h2,{id:"schema-description",children:"Schema Description"}),"\n",(0,s.jsx)(r.p,{children:"In GraphQL, the schema of a service can be described through introspection."}),"\n",(0,s.jsxs)(r.p,{children:["In RAPID, the schema of a service can be described through a ",(0,s.jsx)(r.a,{href:"/docs/spec/servicedescription",children:"request"})," to the ",(0,s.jsx)(r.code,{children:"$metadata"})," endpoint of the service."]}),"\n",(0,s.jsxs)(r.p,{children:["GraphQL defines a simple syntax for defining the shape of a service. Rapid also defines a simple Resource Description Language called ",(0,s.jsx)(r.a,{href:"/docs/rsdl/rsdl-intro",children:"RSDL"}),"."]}),"\n",(0,s.jsx)(r.h2,{id:"query-syntax",children:"Query Syntax"}),"\n",(0,s.jsx)(r.p,{children:"In a GraphQL query, the developer describes the properties to be retrieved, and depth traversed, through a JSON-like structure."}),"\n",(0,s.jsxs)(r.p,{children:["In a RAPID query, the developer describes the properties to be retrieved through a ",(0,s.jsx)(r.a,{href:"/docs/rapid-read#selecting-individual-properties-of-a-resource",children:"projection"}),", and the depth traversed through an ",(0,s.jsx)(r.a,{href:"/docs/rapid-read#including-related-resources",children:"expansion"})," operator."]}),"\n",(0,s.jsx)(r.h2,{id:"filter",children:"Filter"}),"\n",(0,s.jsx)(r.p,{children:"GraphQL does not define predicates that can be applied to filter the membership of the result.\nInstead, GraphQL extensions such as OpenCRUD define use custom operations, defined in schema, to define each type of filter operation."}),"\n",(0,s.jsxs)(r.p,{children:["While RAPID supports ",(0,s.jsx)(r.a,{href:"/docs/operations#functions",children:"custom functions"})," that may be used to encapsulate business logic or other predefined operations, it also defines a ",(0,s.jsx)(r.a,{href:"/docs/rapid-read#filtering-results",children:"filter syntax"})," that can be used to support dynamic queries against properties described by the service as queryable, providing a more flexible way for developers to interact with the data."]}),"\n",(0,s.jsx)(r.h2,{id:"use-of-http",children:"Use of HTTP"}),"\n",(0,s.jsx)(r.p,{children:"GraphQL submits requests using HTTP POST, passing the query in the body of the request."}),"\n",(0,s.jsxs)(r.p,{children:["RAPID builds on REST, using HTTP verbs to GET ",(0,s.jsx)(r.a,{href:"/docs/rapid-read",children:"(retrieve)"}),", POST ",(0,s.jsx)(r.a,{href:"/docs/rapid-edit#creating-a-resource",children:"(create)"}),", PATCH ",(0,s.jsx)(r.a,{href:"/docs/rapid-edit#updating-a-resource",children:"(update)"}
1),", and DELETE ",(0,s.jsx)(r.a,{href:"/docs/rapid-edit#deleting-a-resource",children:"(delete)"})," data. By making fuller use of HTTP, RAPID is able to leverage HTTP Caching and other built-in mechanisms."]}),"\n",(0,s.jsx)(r.h2,{id:"interoperability",children:"Interoperability"}),"\n",(0,s.jsxs)(r.p,{children:["RAPID services can easily support GraphQL Clients through tools such as ",(0,s.jsx)(r.a,{href:"https://www.graphql-mesh.com/docs/handlers/odata",children:"GraphQL Mesh"}),". See our ",(0,s.jsx)(r.a,{href:"/docs/tutorial/graphqlclient",children:"tutorial"})," on building a GraphQL client to access our sample ",(0,s.jsx)(r.a,{href:"/docs/samples/jetsons",children:"Jetsons service"}),"."]})]})}function l(e={}){const{wrapper:r}={...(0,a.a)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},1670:(e,r,t)=>{t.d(r,{Z:()=>d,a:()=>n});var s=t(7378);const a={},i=s.createContext(a);function n(e){const r=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(r):{...r,...e}}),[r,e])}function d(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:n(e.components),s.createElement(i.Provider,{value:r},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.