Skip to content

VincentBlondeau/GraphQL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

GraphQL

A Smalltalk GraphQL Implementation

Installation on VW

This project only works on VisualWorks 7.4, to install GraphQL please load the following parcels on order:

  1. PetitExtensions
  2. PetitParser
  3. PetitTests
  4. GraphQLBeta
  5. GraphQLExtensions
  6. GraphQLBetaDemoSite

Once load all the parcels of our project. If everything is going well, all the test must pass, except the tests of the classes:

  • GQLTypeValidatorTest
  • GQLDocumentTypeValidatorTest

Development

For the moment our application works well for request based on selection sets.

Internals

There are some classes very important on Visual Works for GraphQL:

  • Query: It's the entry point by default of the demo. Also on the class side has defined the schema used by the demo.
  • GraphQLBetaDemoSite: It's the class to start the demo, it works with the schema of the Query class, the entry point is a Query instance and returns the results on JSON.
  • GraphQL: It's the class that attends request and return the answer.

If you want to add your data to the Schema, you can modify the schema method on the class side of Query. Remember that the schema is defined as a text and follows the specifications of GraphQL. Also don't forget to create all the necessary methods (operations) on the instance side of Query to provide the answer according to the schema defined.

Feature ideas

  • Complete parsing of schema.
  • Complete parsing of any valid request.
  • Interpretation of simple request based on selection sets.
  • Add tests for interpretation of request with fragments.
  • Interpretation of request with fragments.
  • Add tests for interpretation of any valid request.
  • Interpretation of any valid request.
  • Add tests for error handling.
  • Error handling.
  • Add tests for type checking rules.
  • Type checking of the rules.
  • Add tests for introspection.
  • Introspection.

Demo

To practice with our demo follow this steps:

  1. Open a workspace and write the following line:
    GraphQLBetaDemoSite demoStart
  1. Open the browser and go to the url: localhost:8888/
  2. Write the following request on the text area:
{
	allFilms{
		name	
	}
}
  1. Press the button Submit.
  2. And you will have the response for this request.

About

A Smalltalk GraphQL Implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published