GithubHelp home page GithubHelp logo

drupal-graphql / graphql-apq Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 7.0 26 KB

Automatic Persisted Queries for Drupal's GraphQL

License: GNU General Public License v3.0

PHP 100.00%
drupal drupal-8 graphql persisted-queries

graphql-apq's People

Contributors

lucasconstantino avatar sebas5384 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

graphql-apq's Issues

Pluggable validation when persisting the query

Having the possibility to persist arbitrary queries (in my opinion) is one of the main reasons people use persisted queries at the build time which is difficult to orchestrate and adds more work when migrating over GraphQL as a public API.

Proposal:
Enable modules to extend the validation rules of queries before they are persisted in order to create their own custom logic that applies best to their business use case.

Persisted Queries are getting cached in Drupal

We are using this module, getting this issue .

Sending new hash with query , registers hash and responds with Data.
When trying to send query with only hash(already registered) and variable , getting response PersistedQueryNotFound. After clearing cache getting response as expected.

Same issue was resolved in Graphql module :-
drupal-graphql/graphql#483

Can we also implement similar approach?

Query with invalid types still return empty data

I have query which is not implemented on Drupal (new content type is not created) but this query still work - returns empty data. If i test same query in /graphql/explorer i get error:

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">LogicException</em>: Missing type ParagraphBoxHeader. in <em class="placeholder">Drupal\graphql\Plugin\GraphQL\Schemas\SchemaPluginBase-&gt;getType()</em> (line <em class="placeholder">421</em> of <em class="placeholder">modules/contrib/graphql/src/Plugin/GraphQL/Schemas/SchemaPluginBase.php</em>). <pre class="backtrace">Drupal\graphql\Plugin\GraphQL\Schemas\SchemaPluginBase-&gt;Drupal\graphql\Plugin\GraphQL\Schemas\{closure}(&#039;ParagraphBoxHeader&#039;) (Line: 319)

I use Angular app as frontend with modiffied Apollo client which first try GET query and then (if is not stored in apq_query_map) send query through POST. But this post still return some data:

{"data":[]}

I think this should return some error. Thanks.

Option to upload query

We would like to use persisted queries, but not automated. It gives us a security benefit, that only the selected queries are allowed for clients.

  1. Option to add/upload queries manually, similarly as in graphql module (https://www.drupal.org/docs/8/modules/graphql/query-maps)
  2. Add an option to disallow unknown queries

Note: Using the persisted queries option provided by the graphql module is not wanted, as it works with a deprecated apollo package. apollographql/persistgraphql#67

How to verify if apq is enabled ?

Hi, I want to use this module to enable apq caching for our drupal graphql but am not too sure how to use this.

I have this module installed and enabled in our environment, but does that mean apq is running? If so how do I verify? Or do I need to create an apollo server separately in order to use this module?

To add to this I am using the drupal grapql module to do our queries.

Thanks!

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.