sikanhe / reason-graphql Goto Github PK
View Code? Open in Web Editor NEWGraphQL server in pure Reason (Bucklescript)
License: MIT License
GraphQL server in pure Reason (Bucklescript)
License: MIT License
The subscriptions support is listed as missing feature. Could you explain what would need to be done to add support for subscriptions? Maybe packages you have in mind to help solve the problem? This would make it easier for someone to contribute with this feature :)
As we are in a JS env it would make more sense. Opening this issue as a suggestion and for the discussion!
Now that we removed Variations - we need a section in read or examples for implementing with reason-promise
and reason-future
and etc
Hello!
Thanks for your work, this look awesome!
I just have one request, would you mind adding a LICENSE.md file?
Thanks again!
I am now working through an issue where I need to return an error from a resolve()
function that is more robust than a simple string
.
TL;DR: Errors returned from resolve
functions are converted to GraphQL errors, but sometimes, we need to turn them into transfer protocol errors, e.g., HTTP 401 responses.
As an example use case, consider an API that has a set of mutations and queries, some of which are publicly accessible while others require to be called by an authenticated user.
These latter APIs require the ability to return an error to the client to signal that authentication is required. However, the execute
layer cannot return an error that is not a string
.
I can hack it by adding a facility to the context which will record such errors, but I think a more direct solution should be available.
Looking at the code, the error case of the resolve
function is bound by the way errors are converted to a Map
in errorResponse()
.
I'm interested in your opinion on the matter, and whether you already have any plans to address it or an existing approach you are using.
I've clone it compile it, run the tests, now how do I run the server?
Reduce the dependency footprint. Right now, due to RationalJS/future#53, I cannot update my bs-platform version to 8.
Since these variations are very simple and short, they could be documented instead of being a part of the source code. There's also the option of making each variation a separate npm module, but it might be overkill.
I'll be happy to submit a PR if you agree with this suggestion.
Reading through the code, it seems like this library is almost a direct port of https://github.com/andreas/ocaml-graphql-server to Reason, but I didn't find the original library's copyright notice or license anywhere in the repo.
Am I missing something?
Hello,
I'm trying to follow the example of reason-graphql-bs-express
but I couldn't open GraphqlJsPromise
module.
Also, a similar issue happens if I try to follow this another example. Compiler points an error on this line on node_modules
related to the same GraphqlJsPromise
module.
Where can I locate this module? Am I missing a dependency?
Thanks in advance!
This is my package.json file:
{
"name": "hello-reason-gql",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "bsb -make-world",
"dev:re": "bsb -make-world -w",
"dev:js": "nodemon src/server.bs.js",
"clean": "bsb -clean-world"
},
"devDependencies": {
"bs-platform": "8.2.0",
"nodemon": "2.0.4"
},
"dependencies": {
"bs-express": "1.0.2",
"reason-dataloader": "0.1.1",
"reason-future": "2.6.0",
"reason-graphql": "0.7.0-beta.1",
"reason-graphql-bs-express": "0.6.0"
}
}
My bsconfig.json file:
{
"name": "hello-reason-gql",
"version": "0.1.0",
"sources": {
"dir" : "src",
"subdirs" : true
},
"package-specs": {
"module": "commonjs",
"in-source": true
},
"suffix": ".bs.js",
"bs-dependencies": [
"bs-express",
"reason-dataloader",
"reason-future",
"reason-graphql",
"reason-graphql-bs-express"
],
"warnings": {
"number" : "-44-45",
"error" : "+101"
},
"namespace": true,
"refmt": 3
}
Hello,
I've been exploring this lib (and reasonml at the same time) quite recently, and even though the swapi example was a really great starting point, i've been missing a few recipes.
So far i've needed to add a scalar in my schema, and define a enum, here's how i've done :
let datetime: 'ctx. Schema.typ('ctx, option(BsLuxon.DateTime.dt)) =
Scalar({
name: "DateTime",
description: None,
serialize: dt => {
let isoDt: string = BsLuxon.DateTime.toISO((), dt);
`String(isoDt);
},
});
let draftValue = Schema.enumValue(~value=Chapital.Draft, "DRAFT");
let publishedValue = Schema.enumValue(~value=Chapital.Published, "PUBLISHED");
let archivedValue = Schema.enumValue(~value=Chapital.Archived, "ARCHIVED");
let assetStatus: 'ctx. Schema.typ('ctx, option(Chapital.assetStatus)) =
Enum({
name: "AssetStatus",
description: None,
values: [draftValue, publishedValue, archivedValue],
});
I'm not sure this is the right way to go (specially about the enum, i saw there was an makeEnum function but couldn't find the proper way to use it).
Cheers
What's the way to implement this in a real-world app? Is it ready to use in a real server?
Also opening as a suggestion for discussing this matter
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.