JSON Schema to GraphQL schema converters [closed] - swagger

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Are there any adapters which are converting JSON Schema schemas (e.g from Swagger) to GraphQL schemas?
There is even an official article about wrapping around REST http://graphql.org/blog/rest-api-graphql-wrapper/, but usually REST already described and Swagger is the most popular format for it.
Wouldn't like to write it by my own if there is already existing implementation.

I actually put some time into trying this out a few months ago. You can read the my post detailing the results here: https://medium.com/apollo-stack/will-graphql-replace-rest-documentation-f1a55092ef9d#.m50im46o0
After looking at a lot of the Swagger schemas available online, I think that Swagger or similar API description languages can be a good starting point for defining a GraphQL schema, but they often don't contain enough information to generate a schema on their own. Specifically, there is usually not enough data about relationships between objects.
If you want to start from a JSON-formatted schema description, all you need to do is write some code that loops over your different data types in Swagger, and generate GraphQLObjectType objects. You can see a simple approach to this in the example repository for the blog post I linked above: https://github.com/apollostack/swapi-rest-graphql/blob/951e50ec29732c93e7aa0bc6880210fdd1816a2f/schema.js#L28
Basically, you are just converting one format of data into another, and then you need to add some relationships between the data (foreign keys, IDs, and such), and add some root queries to create an entry point. In the case of a REST API, it often makes sense to have your single and multiple resource endpoints act as your root query fields.

Also I wrote a library, which allows you to wrap your existing REST API if you use Swagger.
https://github.com/yarax/swagger-to-graphql
It basically does Swagger schema mapping to GraphQL types.
And there is an article about this approach and the library https://medium.com/#raxwunter/moving-existing-api-from-rest-to-graphql-205bab22c184

Meanwhile several tools have been implemented to convert a JSON Schema to GraphQL Schema:
json-schema-to-graphql-types
jsonschema2graphql
json-schema-to-graphql-types-decorated

Related

IOS Backend for User Data [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 months ago.
Improve this question
I am brand new to ios development and am looking for some advice on the best way to structure my user data and access it throughout my app.
Data is retrieved via HTTPS requests that query a database for the desired information. There are separate calls for the different tables containing information of interest. The returned data is formatted as nested dictionaries where the outermost key is the column and the subsequent dictionary is key-value pairs of the index and the table value. Example:
{"column1":{"0":"value1-1", "1":"value1-2", "2":"value1-3"},"column2":{"0":"value2-1", "1":"value2-2", "2":"value2-3"}...}
My primary requirement is that I will need to be able to filter this data by the innermost values (some will be dates, some will be numbers, etc). I would like to have the data in a format that will make this simple to do and will not cause delays as there is no limit on the number of possible rows.
I have looked into reconstructing a user-specific SQLite database with the information and querying that throughout the app as necessary. I have also explored dataframes as this app was originally developed in python - don't ask - and relied on pandas dataframes.
I know this decision will impact me heavily and am trying to do my best to make an informed decision. I appreciate any feedback and am happy to give more useful context that might be missing.
TIA
You can use SQLite database for persistent storage. This is ideal for your main requirement of filtering the data. You should also create a structure or a class modelled on your data to store and use during runtime. You can refer this for deciding between a class or structure.

Which API to use for realtime document collaboration [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I am currently building a virtual classroom website and so far I have successfully added webcam & audio functionality.
The next thing that is on my list is to add realtime document collaboration.
So how this would work is:
Two people join a private session
These two people have a shared document that they can both edit and changes are displayed in realtime to the other user.
An example of this would be google docs where you can be multiple people on one document.
Anyway, I have seen a few APIs that do this, for example I have looked into google docs api, but it requires you to have a google account which is not optimal. (Registering both on my website and on google docs can be a hassle or too much work for some people).
I have also looked into Zoho, but I am unsure if it can fill my needs.
Does anyone of you know an API that can do this? Preferably both document and sheets(excel looking).
Thanks!
The Google Realtime API is especially well-suited for document collaboration, but it sounds like it's not a good fit. There are a few other options out there:
ShareDB is an open-source realtime database backend, used in the DerbyJS framework.
Mozilla's TogetherJS provides view-level collaboration features.
Convergence (disclaimer: I am a founder) is a new hosted platform providing APIs for this sort of functionality. We have identified the most common pain points when implementing realtime collaboration features, and provide high-level APIs to solve them.
Multiplayer is concurrent editing database, it looks like it is based on Operation Transforms and they are planning to launch on Kickstarter. Looks like it can do exactly what you need, and they use Websockets to send changes in real-time.

Is There A Library of Public API Swagger Definitions? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
So I've been building a service that taps into popular APIs around the web and I've found Swagger to be a huge asset to the project. Instead of writing a ton of custom code that is difficult to maintain, I've been able to use Swagger definitions to dynamically create all my requests to the public APIs our service supports.
This has been working well for ~1 year, but we want to continue adding services to our platform and we ended up trading one maintenance burden for another. While there are a lot of public APIs out there, not many of them are nicely packaged in a computer consumable form such as Swagger.
I was wondering if anyone knew of a central location on the internet where a library of Swagger, RAML, API Blueprint, etc are stored.
If such a thing doesn't yet exist it probably should.
There's nothing yet - probably your closest thing would be ProgrammableWeb (just a generic API directory), PublicAPIs (another directory), and APImatic.io (they pull in APIs from several different sources), but there is no set collection of API Blueprint, Swagger, and RAML APIs as these are all open specs.
However, you may be able to contact the different API providers (API Blueprint - Apiary, RAML - MuleSoft, and Swagger - Apigee/ 3Scale) to see if they can provide you with the APIs created in their tools.
Good luck!

Which is a better gem for indextank? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am using indextank with heroku. Which is a better gem to use, indextank or thinkingtank? I looked at the documentation, and tutorials for both,and it seems like thinkingtank is easier to use. A related/follow up question: what are the advantages/disadvantages of each?
It depends on what you're doing. If you are writing a simple app that's not based on ActiveRecord, the indextank client lets you add and search content without storing anything within your app. An example: if you are fetching tweets, you could index them directly without having a data model on your side. It's more "low level", so to speak.
If you are using ActiveRecord or another ORM, you should take a look at Tanker, it's more actively developed than ThinkingTank:
https://github.com/kidpollo/tanker
Hope this answers your question, if not please come chat with us at http://indextank.com (chat widget on the main page) and we'll be happy to help!
As Diego said, Tanker does seem like it has much going for it. Alternatively you could use IndexTanked:
https://github.com/zencoder/index-tanked
We wrote this library to power search on zencoder.com. Documentation is non-existant so far, but is coming.
One important feature included in IndexTanked, that was a necessity for us, was fault-tolerance. IndexTanked includes configurable fallback methods for use in case of failure to index, delete from the index, or search. Additionally, it limits calls to indextank by checking if the indexed fields have changed on updates. You can even obtain which fields we're checking against so you can select the minimum viable fields to be indexed when needed.
You can drop the author, Adam, a line at adam#zencoder.com if you have an questions (perfectly reasonable with the lack of docs).

Car make model dropdown web service [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I once found a slick looking car make/model dropdown menu web service that advertised form helpers for Ruby on Rails, have subsequently been unable to find this again by Googling for it.... Anybody know the service I am talking about?
Edmunds provides this data for free through an API. You just have to sign-up to get an API key.
See documentation here:
http://developer.edmunds.com/api-documentation/vehicle/
Sign-up to get a key here: http://developer.edmunds.com/index.html
One example of making the call (many more examples given on their site):
https://api.edmunds.com/api/vehicle/v2/makes?fmt=json&api_key={your API key}
I was looking for exactly this kind of information for motorcycles. From what I can tell the API does not provide motorcycle data, but it seems to have just about everything for cars - Make, Model, Year, Trim, Style, even Maintenance Schedules.
With the json or xml data, you will have to roll your own drop down menus. Edmunds does provide some premade widgets, but they are pretty specific (e.g. return True Market Value), so there is a good chance they won't have exactly what you need.
http://developer.edmunds.com/widgets_and_apps/index.html
It doesn't include form helpers or anything, but here's a Ruby implementation that uses the KBB database to retrieve make/model info:
http://tektastic.com/2008/03/car-or-auto-make-model-year-database.html
I'd probably cron this outside of the app and update the db from time to time, then use collection_select in the app to construct the dropdowns as normal. You could also adapt it to use ActiveResource for live retrieval, but that seems excessive and perhaps bannable by KBB.

Resources