aerogear / offix-android

Apollo GraphQL offline extensions for Android Platform
https://android.offix.dev
Apache License 2.0
37 stars 16 forks source link

Query regarding generating schema file in sample app using server. #109

Closed Lavanyagaur22 closed 5 years ago

Lavanyagaur22 commented 5 years ago

@wtrocki Graphback generates the schema file in .ts format. How can we get it in json format?

Lavanyagaur22 commented 5 years ago

Also @wtrocki @harshithdwivedi I am facing some problems while generating query and mutation files with relationships. Can you please help me out regarding that?

harshithdwivedi commented 5 years ago

Hm, i tried running graphback generate but it only generated the .ts files and not json Maybe @wtrocki has some idea?

Lavanyagaur22 commented 5 years ago

Also, this is the mutation file I have created based on the schema in the server.

mutation checkAndUpdateTask($id: ID!, $title: String, $description: String, $version: Int!, $status: String!){
    checkAndUpdateTask(id: $id, title: $title, description: $description, version: $version, status: $status){
        id
        version
        title
        description
        status
        creationMetadata{
            createdDate
            createdBy{
                id
                firstName
                lastName
                title
                email
            }
        }
        assignedTo{
            id
            firstName
            lastName
            title
            email
        }
    }
}
Lavanyagaur22 commented 5 years ago

@wtrocki @harshithdwivedi Can you please add type query in the schema too? This would help us in querying and getting lists of tasks which will help us in UI bindings in the sample.

wtrocki commented 5 years ago

@Lavanyagaur22 Server is now part of the offix-android so please add anything to the schema that you will require.

Apollo provides CLI for generating JSON file. Servers will never expose any json file, but if you think that is required let me know. https://github.com/apollographql/apollo-tooling#apollo-clientdownload-schema-output

wtrocki commented 5 years ago

Btw.. This server is simply now Apollo GraphQL server - we do not need to use Graphback anymore - it just gave us implementation we required.

wtrocki commented 5 years ago

I am facing some problems

Can we be more specific? If there is issue with generated code let me know. We can create issue in graphback and fix it. For custom code fee free to change stuff etc.

wtrocki commented 5 years ago

Can you please add type query in the schema too

Not sure what you mean by type Query. Check playground there are queries there.