Giter Club home page Giter Club logo

Comments (15)

vladar avatar vladar commented on August 27, 2024

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.

TimothyKrell avatar TimothyKrell commented on August 27, 2024

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.

arec avatar arec commented on August 27, 2024

I've already done this with a bit help from graphql-lavarel. Here are few things missing that I've done:

  1. [MOST IMPORTANT] a function to export a schema.json file for RelayJS. I'm currently using a really BIG QUERY to generate it.
  2. NodeInterface
  3. tool to generate connectionTypes and mutationTypes

from graphql-php.

vladar avatar vladar commented on August 27, 2024

@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.

arec avatar arec commented on August 27, 2024

Great thanks. Never notice that REALLY BIG QUERY is right there!

from graphql-php.

TimothyKrell avatar TimothyKrell commented on August 27, 2024

@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.

beeb avatar beeb commented on August 27, 2024

@arec +1, I'd really like to see what you've done!

from graphql-php.

Gugudesaster avatar Gugudesaster commented on August 27, 2024

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.

vladar avatar vladar commented on August 27, 2024

@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.

vladar avatar vladar commented on August 27, 2024

Also check out Relay specs for GQL types: https://facebook.github.io/relay/docs/graphql-relay-specification.html#content

from graphql-php.

ivome avatar ivome commented on August 27, 2024

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.

vladar avatar vladar commented on August 27, 2024

@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.

TimothyKrell avatar TimothyKrell commented on August 27, 2024

@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:

You might want to add those to the Readme as well.

from graphql-php.

ivome avatar ivome commented on August 27, 2024

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.

vladar avatar vladar commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.