Comments (15)
I'd be happy to do so, but realisticly - can't provide any timeframes on when this will be done. Contributions are welcome if you get there before me!
Separate repo is another option.
from graphql-php.
Thanks for the reply! I'll definitely do a pull request if I get there first, but I'm much more of a novice at PHP. Thanks for this library! I'm currently testing using it with out Laravel backend.
from graphql-php.
I've already done this with a bit help from graphql-lavarel. Here are few things missing that I've done:
- [MOST IMPORTANT] a function to export a schema.json file for RelayJS. I'm currently using a really BIG QUERY to generate it.
- NodeInterface
- tool to generate connectionTypes and mutationTypes
from graphql-php.
@arec about RelayJS schema - use query from GraphQL\Type\Introspection::getIntrospectionQuery()
to generate schema.json
. It's a regular introspection feature of GraphQL.
I currently do it via custom node-js script that uses same introspection query from graphql-js, in case if someone is interested:
#!/usr/bin/env babel-node --optional es7.asyncFunctions
import fs from 'fs';
import path from 'path';
import { introspectionQuery } from 'graphql/utilities';
import rp from 'request-promise';
var options = {
uri: 'path-to-your-graphql-endpoint',
method: 'POST',
form: {
query: introspectionQuery
}
};
console.log('Requesting schema from', options.uri);
rp(options)
.then((result) => {
var fname = path.join(__dirname, '/schema.json');
console.log('Successfully retrieved schema (' + (result||'').length + ') . Writing to ' + fname);
fs.writeFileSync(
fname,
result
// JSON.stringify(result, null, 2)
);
})
.catch((result) => {
console.error(result);
});
Wanted this to be integrated with JS workflow, hence JS version vs PHP.
from graphql-php.
Great thanks. Never notice that REALLY BIG QUERY is right there!
from graphql-php.
@arec, could you post a gist or something with your code for the NodeInterface, connectionTypes, and mutationTypes so I could see how you are doing it?
from graphql-php.
@arec +1, I'd really like to see what you've done!
from graphql-php.
Does anyone have a solution or workaround here? I would really like to play around with graphql and relay, but can't seem to get it working with the current package.
from graphql-php.
@Gugudesaster Tools in https://github.com/graphql/graphql-relay-js are simple helpers around GraphQL system.
They do not provide special structures or algorithms - they just slightly simplify creating GraphQL types specific for Relay. You should be able to create such types even without those helpers.
Can you share what exactly blocks you?
from graphql-php.
Also check out Relay specs for GQL types: https://facebook.github.io/relay/docs/graphql-relay-specification.html#content
from graphql-php.
FYI: I'm currently working on an exact port of https://github.com/graphql/graphql-relay-js to PHP based on this repository here. Should be there soon...
from graphql-php.
@ivome That's great! When you're done - post the link here to your repo and I'll add it to Readme.
from graphql-php.
@ivome Nice! Can't wait to see what you come up with.
@vladar Thanks for this awesome library. Currently I've been using these Laravel specific packages based off of your port:
- GraphQL: https://github.com/Folkloreatelier/laravel-graphql
- Relay helpers: https://github.com/nuwave/laravel-graphql-relay
You might want to add those to the Readme as well.
from graphql-php.
I'm not done yet, but I just published the repo: https://github.com/ivome/graphql-relay-php
The basic helper functions are all in place along with their tests. There are still a few things left to be done. Especially documentation is lacking. If someone wants to help, check out the issues: https://github.com/ivome/graphql-relay-php/issues
from graphql-php.
Nice! Will throw away my current hackish helpers and use your repo instead.
Added section to Readme on Complementary tools. Guess I can finally close this issue %)
from graphql-php.
Related Issues (20)
- Replace static variables and statically referenced types with instance based TypeRegistry HOT 4
- Potential unaddressed DDOS vector - how can I privately report this? HOT 4
- SchemaPrinter: Unicode in field description is escaped when description is single line HOT 3
- Support Defer and Stream Directives HOT 7
- PHP attribute field definition for not null? HOT 3
- [Support] How to get AST from extended Schema
- QueryComplexityRule seems to attempt to parse input variables repeatedly HOT 2
- How to use BreakingChangesFinder?
- amphp/amp v3 compatibility HOT 5
- Defining a fragment before the query results in an error HOT 2
- Improve performance by disabling return/resolved values validation HOT 13
- OverlappingFieldsCanBeMerged throws an error when querying same field w/ and w/o attributes for different union types HOT 1
- Order of input object values HOT 1
- Merge schema.graphql files
- Issue when passing nested structure
- File upload example
- Passing array to misspelled query/mutation results in error HOT 1
- Looking for Library to work with AWS AppSync (non amplify) HOT 3
- The GS character is invalid HOT 1
- Define field resolver using `SchemaExtender` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-php.