Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GraphQL language primitives for ReScript/ReasonML written in ReasonML

License

NotificationsYou must be signed in to change notification settings

teamwalnut/graphql-ppx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Typesafe GraphQL operations and fragments in ReasonML

Build Statusnpm version

DocumentationFeaturesInstallationUsageRoadmapContributingLicenseAcknowledgements

Documentation

Go to the official documentation

Features

  • Language level GraphQL primitives

  • Building block for GraphQL clients

  • 100% type safe

Installation

Schema

graphql-ppx needs your graphql schema to be available in the form of agraphql_schema.json file.

The easiest way to add this to your project is using anintrospection queryto your backend. You can do this usingget-graphql-schema:

npx get-graphql-schema ENDPOINT_URL -j> graphql_schema.json

WithENDPOINT_URL being the URL of your GraphQL endpoint.

Cache

graphql-ppx will generate a.graphql_ppx_cache folder alongside your JSONschema to optimize parsing performance. If you're using a version controlsystem, you don't need to check it in.

The next pages will provide further installation instructions whether you areusinggraphql-ppx with Bucklescript or using Reason Native.

Bucklescript

First, add it to you dependencies usingnpm oryarn:

yarn add @reasonml-community/graphql-ppx --dev# ornpm install @reasonml-community/graphql-ppx  --saveDev

Second, add it toppx-flags andbs-dependencies in yourbsconfig.json:

"ppx-flags": ["@reasonml-community/graphql-ppx/ppx"],"bs-dependencies": ["@reasonml-community/graphql-ppx"]

Native

Caution!

The Bucklescript version ofgraphql-ppx was almost completely rewritten for the1.0 release, with many improvements and changes. This documentation will focuson the API of the bucklescript version. This means that most of the exampleswon't apply for the Reason Native version. Please take a look at theold documentation.At the same time we welcome contributions to modernize the Reason Native versionofgraphql-ppx:::

You need to provide the following dependency in youresy.json file

{"dependencies": {"graphql-ppx":"*"  },"resolutions": {"graphql-ppx":"reasonml-community/graphql-ppx:esy.json#<use latest stable commit from master>"  }}

and update yourdune file:

(preprocess (pps graphql_ppx))

Usage

Make your first query:

Reason

[%graphql{|  query UserQuery {    user {      id      name    }  }|}];

ReScript

%graphql(`  query UserQuery {    user {      id      name    }  }`)

Open getting started in the docs

Roadmap

See ourdevelopment board for a list of selected features and issues.

Contributing

We'd love your help improvinggraphql-ppx!

Take a look at ourContributing Guide to get started.

License

Distributed under the MIT License. SeeLICENSE for more information.

Acknowledgements

Thanks to everyone whocontributed tographql-ppx!

This project builds uponmhallin/graphql_ppx. It wouldn't be possible withoutgreat work ofmhallin/graphql_ppx contributors.1

About

GraphQL language primitives for ReScript/ReasonML written in ReasonML

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors29

Languages


[8]ページ先頭

©2009-2025 Movatter.jp